Setting Up Host Records on Registrar

Joined
May 9, 2015
Messages
239
Likes
64
Degree
0
I want my sites to resolve to http://mydomain.com and not www.mydomain.com, so I've created a URL redirect record for the www host.

Is this the recommended way of doing it for SEO purposes so you don't have the www subdomain competing with the root domain in the rankings?
 
That's one way to do it. What I do is use .htaccess:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

That's one way of getting it done. That says in human language, "Check the condition of any page being loaded, and if it includes www, drop that off and 301 it to the version without www, Not just homepage, but all pages"
 
Back