Forum Moderators: phranque
I want to redirect all requests from example.com to www.example.com, except for any requests for the resource which are secure (https) connections.
My site is available under:
http://www.example.com/
and under a shared SSL certificate:
https://ssl.myhostingprovider.net/example.com/
So I don't want anything redirected when the connection is secure.
I tried the following code in the .htaccess:
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$ [OR]
RewriteCond %{HTTP_HOST} !^www.example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301] But this gives an infinite loop. Where am I going wrong?
Thanks!