WordPress SSL & AWS Elastic Beanstalk Redirect Loop
-
Just putting this out there for anyone that encounters the same issue once upgraded to WP 4.0
Up to 3.9.2, the canonical redirect function did not seem to check the protocol when redirecting to the siteurl config, at least as far as I can tell.
That means the HTTPS auto-redirect was done in the htaccess file based on the X-FORWARDED-PROTO header present in the request from the load balancer.
WP 4.0 seems to now check the protocol if the siteurl is set to https://*, which results in a redirect loop since Beanstalk applications use standard HTTP requests behind the load balancer.
If you are caught unable to access your site which auto-redirects to HTTPS, you can fix it with the following steps:
1. Change the ‘siteurl’ and ‘home’ options in the wp_options database table to be http only.
2. Temporarily disable any HTTPS redirects in the htaccess file, this should get you access to the admin panel at least.
3. Install the canonical redirect disabler from here into the /plugins directory
4. Activate the redirect disabler plugin
5. Set the site URL and home address in Settings -> General back to HTTPS
6. Re-instate the HTTPS redirect in the htaccess file based on the X-FORWARDED-PROTO header
You should now have auto-redirect to SSL functioning correctly again. Hope this helps anyone that faces the same issue.
The topic ‘WordPress SSL & AWS Elastic Beanstalk Redirect Loop’ is closed to new replies.