Link to home
Start Free TrialLog in
Avatar of badgettz
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.
Avatar of kentcomputers
kentcomputers

Check your DNS Record!
Avatar of badgettz

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?
Sorry I should've gave more details. It is plesk running on linux, there is no php redirecting it.
ASKER CERTIFIED SOLUTION
Avatar of kentcomputers
kentcomputers

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try with this code in .htaccess file.
<!-- Rewrite Rule -->

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

Open in new window

Several good points. Will check everything again.