I run a WordPress behind a other (main) webserver. The main Server does have a rule to redirect all requests to /wpa to the WordPress Server with a ProxyPass

ProxyPass /wpa/ http://vm.example.com/wpa/
ProxyPassReverse /wpa/ http://vm.example.com/wpa/

WordPress itself comes with this .htaccess file at the WordPress root:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wpa/

RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wpa/index.php [L]

Everything is working fine with http. But I want to switch to https and this is a problem.
The SSL termination is done at a Load Balancer.

The thing is, that all traffic behind the Load Balancer is non-ssl.
If I change the WordPress homeurl and siteurl from http to https, I get a redirect error (loop).

I tried to use a rule like this at the main server:

RewriteCond %{HTTPS} !=on
RewriteRule ^/wpa/(.*)$ https://www.example.com/wpa/$1 [L,R=301]

Still get a redirect error. I tried to check RewriteLog but I failed finding the right information.

Does anyone have a clue how to fix this?

Read more here: Changing WordPress http to https behind a Load Balancer with ProxyPass


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: