0

I got so many references for this error in WordPress hosted on an EC2 with ALB on top. I have the rule which redirects any http requests to https at ALB, and then transfers the request to port 80 of EC2. I have the below .htaccess & my siteurl and home within wp_options are https://demo.mydomain.com. Still I get the err_too_many_redirects error when browsing the domain https://demo.mydomain.com/wp-admin

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

If I change siteurl & home in wp_options as http://demo.mydomain.com, then I get the login page (without any images or CSS loading) and I can see mixed content error. I am not sure what else I need to look at. And I am unable to login to admin page in either case.

Any immediate help would be really appreciated.

serverstackqns
  • 562
  • 2
  • 9
  • 26
  • You need to configure Apache to serve `https` URLs, and you need to configure it to check the `x-fowrwarded-proto` HTTP header to verify if the site is being served over HTTPS since the protocol between the ALB and Apache will be HTTP. I believe this answer: https://stackoverflow.com/a/13997498/13070 and this: https://stackoverflow.com/a/26623196/13070 show how to do that. – Mark B May 06 '23 at 14:39

0 Answers0