If you would like to exclusively use either the www or non-www version of your domain, this can be through the redirects area of cPanel. Redirecting a domain to either the www version or non-www version is a little different from redirecting one domain to another, so we've created this article to walk you through how to do either one.
This type of redirection can help with URL canonicalization by search engines. URL canonicalization refers to the process by which a search engine decides which version of your site's URL is best to display in search results. By redirecting to one version of your site, you will have more control over which URL appears in search results. Per Google Webmaster Guidelines, this may also help to limit possible dilution of page rank that can occur if Google can't determine which version of your URL should be preferred.
First, you will want to decide which version of your site you prefer. This is really a personal preference and the only important thing is to be consistent. So, it's best to pick one up front and stick with it.
3 Points
|
2012-11-06 2:55 am
Great article on setting up the redirect.
Would it be best to check the Wild Card Redirect also? Won't this further help URL canonicalization so that all pages on the site use the same domain. For example, mydomain.com/news.html would get redirected to www.mydomain.com/news.html |
Staff 17,314 Points
|
2012-11-06 4:02 am
Hello Chuckyaynesphoto,
If you are trying to make all of your URLs redirect in that fashion, then yes, that is a very good idea. If you have any further questions, please contact technical support or leave a comment at the bottom of the page. Regards, Arnel C. |
n/a Points
|
2015-08-08 6:55 pm
im creating 301 redirect for cannocial for seo purpose but while opneing the link its showing a path ending with .html...i dont want to show .html while link is open |
Staff 12,339 Points
|
2015-08-10 5:52 pm
Hello prashant,
Thank you for contacting us. Here is a link to a helpful guide I found via online search, on Removing file extensions using htaccess. You may have to customize the code, depending on your other .htaccess rules. Thank you, John-Paul |
n/a Points
|
2015-10-28 11:53 am
Thanks for your help :) |
n/a Points
|
2018-04-06 11:03 pm
How come my domain is always showing www no matter how I redirect it to a non www name. eg. typing abc.com always shows up www.abc.com on the browser, I just want it to abc.com without www. |
Staff 619 Points
|
2018-04-06 11:11 pm
The redirect described in this article should work to force www.abc.com to abc.com. However, if you are using a Content Management System (CMS) like WordPress for example, you would need to configure WordPress to use the domain without "www", otherwise it may result in undesired behavior. If you are using another CMS, let us know which one, we may have a guide to assist you with it.
|
n/a Points
|
2018-08-31 10:44 am
Hi, thanks for this I did the redirect from www. to non-www (the second one). When I tried to load the website I got the error too many redirected. This occured when I tried the url with the www. and without. Any ideas? |
Staff 536 Points
|
2018-08-31 10:27 pm
I recommend ensuring the A records for [yourdomain] and www.[yourdomain] point to the same server. Then check that there aren't redirects created elsewhere - within the website, a CDN, etc..
|
n/a Points
|
2018-09-16 6:11 am
Thank you for your response. What is an A records, and where can I check where they point to? I'll check the website too. Thanks in advance! |
Staff 619 Points
|
2018-09-17 8:12 pm
An A record is a type of DNS record that is used to translate your domain name into a computer readable IP address. These records are configured in the nameserver that your domain is pointed to. If you are pointed to WebHosting Hub's nameservers, then you can view the DNS records from your cPanel. If you are not pointed to WebHosting Hub's nameservers, you should look for these records where you maintain the DNS for your domain.
|
n/a Points
|
2018-10-21 8:44 pm
Thanks for sharing a very good and informative article, and I have added the non-www to www 301 redirection code in the .htaccess file, and I also do the same steps that u mentioned above in the article for "redirecting www URL". I want to know that should i delete the code in the .htaccess file or not? Here is the code i was added in the .htaccess file. RewriteEngine OnRewriteCond %{HTTP_HOST} ^example.comRewriteRule (.*) http://www.example.com/$1 [R=301,L] |
Staff 619 Points
|
2018-10-22 6:07 pm
You're welcome Moeez. cPanel adds the code for the redirect to the .htaccess file. You do not need to add additional code. I do not recommend removing the code, otherwise the redirect will not work anymore. I hope this helps!
|
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: | 757-416-6627 | Chat: | Click To Chat Now |
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!