After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
How to redirect www.xxx.com to xxx.com or vice versa
-
Roger has detected a problem: We have detected that the domain www.xxx.com and the domain xxx.com both respond to web requests and do not redirect. Having two "twin" domains that both resolve forces them to battle for SERP positions, making your SEO efforts less effective. We suggest redirecting one, then entering the other here.
hi, i tried creating the campaign and this message popped out.. i dono what to do or how to redirect b/w www.xxx.com and xxx.com ( xxx = hidden site) am using godaddy domain and hosting at hostgator.
thank you.. waiting for ur reply
-
OK - just a REFRESH problem!
I canceled the campaign creation and started from scratch again. And this time I had no error message.
Thanks everyone!
-
Hi everyone, I had the same problem and found this wonderful thread! Thanks a lot! Now, if I check the header of http://domain.com with the tool you suggested, I get the correct message:
HTTP/1.1 301 Moved Permanently Date: Sat, 22 Oct 2011 09:13:19 GMT Server: Apache Location: http://www.domain.com/ Content-Type: text/html; charset=iso-8859-1
However, when I try to continue with the campaign creation on SEOmoz, I stille get the same message as I did before. Is there a way to fix this? Am I doing something wrong? Here is my .htaccess:
ptions +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule ^index.html?$ / [NC,R,L]
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
Thanks for your help! I hope you can guide me to sort things out!
-
yes it works.. thanks keri

-
Yes, the 301 response is what you're looking for. Test a couple of your interior pages in addition to just your home page to make sure it works right, then you're good to go!
-
Here's how I do it in .htaccess in Linux:
RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]If you already have a RewriteEngine in your .htaccess, you can skip that part.
What this does is check if the host contains www. If it doesn't it redirects to www. version. You can find more info here: http://www.stevefortuna.com/redirect-to-www/
-
1. Requesting: http://xxx.com
<dl>
<dt>server Response:</dt>
<dd>HTTP/1.1 301 Moved Permanently Date: Wed, 06 Jul 2011 11:42:26 GMT Server: Apache mod_fcgid/2.3.6 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Location: http://www.xxx.com/ Cache-Control: max-age=3600 Expires: Wed, 06 Jul 2011 12:42:26 GMT Vary: Accept-Encoding Content-Type: text/html; charset=iso-8859-1
</dd><dd>I got this.. is this right?
</dd></dl>
-
-
There are few safe ways you can re-direct your domain from non-www to www, they include:
-
having a small code in your .htaccess if you are running linux
-
in your header, you can specify where to redirect your site
We need to know the sort of platform your site is running on i.e. Windows; Linux as well as the platform or scripting language you are using i.e. asp; .NET or php
Also make sure in your webmaster tools to allow Google to know which one to use, so in your webmaster tools specify you want to use the www or non-www
Hope this helps, if you need more advice or help let me know
-
-
To see if you did it correctly, put in the non-www domain into a server header checker like http://www.seoconsultants.com/tools/check-server-headers-tool/ and see if it uses a 301 redirect to redirect to the www domain (or vice versa, if you set it to remove the www).
If that didn't work, we're happy to help walk you through doing this! What we'll need from you is a little more information about your server. Specifically, if you're using IIS or Apache, and if you're using a content management system. That will help us give you the right info if you still need help.
-
i think i did it...

Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Explore more categories
-
Chat with the community about the Moz tools.
-
Discuss the SEO process with fellow marketers
-
Discuss industry events, jobs, and news!
-
Chat about tactics outside of SEO
-
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
-