http to https redirect: How not to create an infinite loop

by bootsmaat   Last Updated October 30, 2017 19:04 PM

I have a wordpress install on a subdomain: https://blog.mgieselmann.com

To enforce SSL I have the following redirects in my .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On

# BEGIN FORCE HTTPS
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301]
# END FORCE HTTPS

# BEGIN WordPress
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

</IfModule>

This used to work until a while ago. Now, when calling http://blog.mgieselmann.com, I get:

Moved Permanently The document has moved here. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

What's wrong with the .htaccess?



Related Questions


.htaccess IP whitelist is being ignored

Updated June 27, 2016 09:01 AM