I was able to resolve the problem by adding $_SERVER[‘HTTPS’]=’on’; into wp-config.php. I don’t know why $_SERVER[‘HTTPS’] is not set properly by the system, but I guess its somehow related to Apache/SSL configurations.
Without setting $_SERVER[‘HTTPS’]=’on’ WP was not able to detect HTTPS and was loading content over HTTP which with .htacccess redirects caused redirect loop.