badgettz
asked on
www redirects to non-www with no .htaccess, why?
I been trying to get this to work correctly, I have a .htaccess that does not redirect. Yet everytime I go to the www of the website it redirects to the non-www.
Check your DNS Record!
ASKER
dns is set up correctly (I have double check many times, I'll even check again)...I have hundreds of other domains set up the same way.
Is plesk or something in the PHP redirecting it? Does it redirect if you put a static index page up?
ASKER
Sorry I should've gave more details. It is plesk running on linux, there is no php redirecting it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try with this code in .htaccess file.
<!-- Rewrite Rule -->
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
ASKER
Several good points. Will check everything again.