Redirecting a domain
-
I was setting up a new campaign and received the following error from Roger Robot.
"We have detected that the domain www.sitename.com and the domain sitename.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."
I know about redirecting a PAGE using 301 Redirects and how to specify the www. canonical in Google webmaster tools, but is there a "DOMAIN" redirect that I'm missing.
What would you suggest doing given the error message above.
Thanks,
Bill
-
I thought it would be super cool if someone would post the exact syntax to use in .htaccess to make this happen. For all the hordes of info out there on redirects and htaccess, it's amazingly hard to find the code for this one. Here is what worked for me:
<code>RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]</code>
-
I looked at the server headers for the URL mentioned in the screenshot, and the site is running IIS6. I don't have the instructions for doing the domain redirect for that handy, and it's been ages since I've done it, but at least now we know we can't just say use .htaccess.
-
Thanks for the info.
I'll dig in and see what I can find.
-
I'm getting access to the FTP and Host Server.
If they have a cPanel I'll look for that. May need your help later, once I know more what I'm dealing with.
Thanks so far
-
If you're using Firefox, go get the Domain Details addon
https://addons.mozilla.org/en-us/firefox/addon/domain-details/
Then go surf to your site and it should tell you (based on the headers) what kind of server you're running (for instance, seomoz is running Apache 2.2.14)
The most common solution is using htaccess, which can determine at the server level which version to show and 301 all traffic there. Not all web servers support this, though (which is why Kyle asked the question). IIS7+ can support it, as can the most popular open source ones (nginx, lighthttpd, Apache).
Here's an article on how it works
http://www.seomoz.org/blog/rewriterule-split-personality-explained
-
You would probably need more information than just looking at the client side. The only way that could work out is if the file extensions were .aspx or .php or something like that.
Essentially what i was getting to, is you would set the redirect differently depending on what type of hosting you are using. If it was microsoft base you would set it in IIS, while if it was linux based you would added it to your root .htacess file.
Hope that helped!
-
not sure... this site belongs to a friend. Can I tell from just looking at the html or do I need to access the server/host?
-
What type of hosting/server do you have linux based or microsoft?
-
Hi Bill.
Your issue is a common one and yes, there is a solution.
First step is to determine which version of a URL you wish to represent your site, with or without the www. For purposes of this discussion I'll assume you wish to keep the www prefix. In that case, you need to set up a redirect to send all non-www traffic to it's www equivalent.
If you have cPanel access to your web server, you should find a Redirect tool there. Otherwise, you need to modify your htaccess file. If that less sentence is not something you are familiar with, then contact your web host and let them know your wishes. They can easily set this up for you.
For a demo of how it works, type in "google.com" in your web browser. Notice how the address is always changed to http://www.google.com/. That action is because of a properly configured redirect.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Multisite domain
good morning I have a wordpress site I have activated the multisite, currently the site has a domain authority of 8, when I publish a post, it is indexed quite quickly, if I publish a post in a language other than the /es subdomain it takes 24 hours why? If the author domain is the same, why does the employee take longer to be indexed on Google? Thank you
Technical SEO | | alainscilly770 -
301 redirected all my pages to my new domain, now I have a problem with Google Search Console
Hi guys! I bought a new domain name and redirected all my URLs from the old domain to the new one. Everything worked perfectly but now I have a little problem. I want to use the option 'Address Change' in google search console. Step 1 Works (Select new website in the list) Step 2 Works (Confirm that the 301 are working) Step 3 Asks me to Verify the old domain (huh!?) in order to complete the request. Obviously that doesn't work because my 301s WORKS! So if I try to verify the old website by putting a google file in the root of my domain Google tries to access it and it automatically redirects to the new domain. I must be missing something lol help!
Technical SEO | | benoit_20180 -
Penalized domain redirected to the non-penalized one...
I've a technical question , For example site A was penalized by google updates, panda and penguin both and site b is in the same niche and it's running good and never been penalized by updates. If I redirect site A to Site B with 301 status code(permanent redirect), will Google penalize the site B too? because penalties travel from old domain to new one as per google's algorithms. And If yes then how can I stop my competitor from removing redirection of penalized domain to mine?
Technical SEO | | hammadrafique0 -
Redirect effecting ranking?
I manage the SEO for several different regions which are also based on the same site e.g. example.com/au, example.com/us The /us site has pretty good rankings and changes I'm making to the site are having an impact. The /au site has really bad rankings, even though much of the content is the same. (The /uk site is also awful but we had an issue with 4,500 duplicate pages which were only resolved last week). Crawl diagnostics are only showing 1 major error for a 404 response, I'm receiving a domain authority of 43 and A grade page ranking for some of our targeted keywords. I could believe that this isn't necessarily going to get us a top 10 rating but I would have thought we would be in the top 50, especially for branded keywords. Could the lack of ranking be to do with how our domain redirects? If you go to example.com.au you are taken to the home page rather than being redirected to example.com/au. Once you head to an internal page the URL changes to example.com/au/page
Technical SEO | | ahyde0 -
Redirects in site map
I have a site with the ace/sef ( creates friendly URLS) in a large data base site. It creates a site map dynamically. Yet I realize one issue which I am trying to think through. I recently changed my urls to include an ID number example: homepage/houses/1134-big-blue-house The prior url was: homepage/houses/big-blue-house the original url above redirects to the new one with the ID like I want. However the site map has both URLS in it which go to same page I am not sure but it seems rather stupid to have the new URL and OLD redirected URL in the site map. Yet beside stupid I am wondering if this is duplicate content and will cause a penalty from the google bot. What is your opinion ?
Technical SEO | | aimiyo0 -
Code for redirect
What is the code to redirect www.xyz.com/abc where abc is a folder to www.xyz.com/abc.html
Technical SEO | | seoug_20050 -
Keyword rich domains
Hi, Our site is beingthere.com.au We are in the business of video conferencing in Australia. I was wondering if there would be any benefit of purchasing keyword rich domains such as www.videoconferencing.net.au www.video streaming.net.au What would be the benefit(s)? And How would I go about using these domains to maximise SEO benefit? Thanks Dan
Technical SEO | | dantmurphy0 -
Wordpress 301 redirects
I use wordpress as CMS on a few sites and I noticed that word press automattically places 301s if I change a url etc. I believe it does it by having the following in the .htaccess file: BEGIN WordPress<ifmodule mod_rewrite.c="">RewriteEngine OnRewriteBase /RewriteRule ^index.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</ifmodule> END WordPress Should I use this? I feel like it limits my control over the 301s.
Technical SEO | | mmaes0