Forum Moderators: phranque
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) [%{HTTP_HOST}%{REQUEST_URI}<...]
This was added to redirect http to https.....so the entire site is now in https version
I need help with redirecting it to a www version from non-www....
When i type mydomain.com i should be redirected to [mydomain.com...] instead of [mydomain.com...]
Right now am landing on [mydomain.com...] when i type mydomain.com
I have tried 301 redirect but its taking me to [mysite.com...]
I don't understand whats the error....
RewriteEngine On
# Redirect ANY non-www request to https and www
RewriteCond %{HTTP_HOST} !^(www.\.example\.com)?$
RewriteRule (.*) https://www.example.com/$1 [R=301,L]
# Redirect ANY HTTP request to https and www
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://www.example.com/$1 [R=301,L]