: Point naked URL to www in cPanel Simply I am trying to do this: When a person types myurl.com it will convert into www.myurl.com and when person types www.myurl.com it stays www.myurl.com (mainly
Simply I am trying to do this:
When a person types myurl.com it will convert into myurl.com and when person types myurl.com it stays myurl.com (mainly I want to do this for search engine optimization, so Google doesn't think I have 2 domains, naked and with )
I am pointing DNS from Netfirms to my website hosted at another hosting company that uses Litespeed on Linux instead of Apache.
Control panel is cPanel and I have access to DNS management on server through it.
As I know it has something to do with A records, and that's how much I know. Please be specific if you're going to answer.
More posts by @Yeniel560
1 Comments
Sorted by latest first Latest Oldest Best
As far as I'm aware, Litespeed also supports mod_rewrite in .htaccess files. So, if you don't already have a file called ".htaccess" in the public root of your website, create it and insert the following script...
For single domains
Options +FollowSymLinks # Must be enabled if not already
RewriteEngine On
# Redirect none WWW to WWW
RewriteCond %{HTTP_HOST} ^myurl.com
RewriteRule ^(.*)$ www.myurl.com/ [R=301,L]
As far as Google is concerned, you can specifically tell Google which version (www or none www) of your site you would prefer in search results within Google Webmaster Tools. You just need to register your site if you haven't already. If you had already done the .htaccess method then you don't necessarily have to explicitly tell Google as it will pick it up.
This solution obviously doesn't add any additional DNS entries.
...EDIT...
For multiple domains
Options +FollowSymLinks # Must be enabled if not already
RewriteEngine on
# Redirect none WWW to WWW - Multiple domains
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^another.com [NC]
RewriteRule ^(.*)$ www.%{HTTP_HOST}/ [R=301,L]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.