I recently added SSL to my wordpress site and now if some goes to my http site, I would like to redirect them to my https site. I have tried the following below:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
But got this error
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
What am I doing wrong?
Here is the code that you should use for enforcing https:
Try this :