Canonical or 301 redirect, that is the question?
-
So my site has duplicate content issues because of the index.html and the www and non www version of the site. What's the best way to deal with this without htaccess? Is it a 301 redirect or is it the canonical, or is it both?
-
No problem! I'm curious what solution you are planning to choose and of course, if it helped you rank higher.. although that sort of data will only be available in a couple of months of course.
-
I'd agree that, theoretically, 301-redirects are better here, but if it's just the home-page, a canonical tag can definitely sweep up any problem duplicates. If you're getting www and non-www versions of multiple pages indexed, then you probably need 301s. I'd check the index with the site: operator and see. If you're really getting multiples of both indexed, you probably have internal linking issues (inconsistencies). Step 1 in any de-duplication is to make sure you're always linking to the same version. Same with "index.html" - link to "/" internally or the absolute URL of the site (without "index.html").
PHP (code-based) redirects should be fine, as long as they resolve correctly. I've used code-based headers in some other languages (like ColdFusion) and it's generally been ok. If that gets messy, though, and if it's just the home-page, the canonical tag will do in a pinch.
-
Thanks for your tips.
-
I would say 301 redirect. e.g. in PHP you can use:
/home.html to /
if ($_SERVER['REQUEST_URI'] == '/home.html') {
header('HTTP/1.1 301 Moved Permanently');
header('Location: /');
}
non-www to www
**if ($_SERVER['SERVER_NAME'] == 'example.com') **{
header('HTTP/1.1 301 Moved Permanently');
header('Location: www.example.com' . $_SERVER['REQUEST_URI']);
}
Good luck!
-
what about using a php 301 redirect? is that also a good option? I'm looking for the simplest solution that doesn't mess up my seo efforts.
Thank you
-
Hi Joel!
Googles recommendation for this is a 301 redirect.
If you need to change the URL of a page as it is shown in search engine results, we recommended that you use a server-side 301 redirect.
More reading: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=93633
In other case, if you dont have access to do it server-side, then a canonical is better then nothing.
Good luck!
-
Hi Joel,
I'd say a 301 redirect using your HTaccess file is best. However, if you cannot access the htaccess file i'd go with the rel canonical. Otherwise you would be using meta refresh or javascript and the like, which are generally not appreciated by Google. Besides, if the page is truly a duplicate the canonical link tag usually does the trick anyway!
Good luck,
Sven Witteveen
Expand Online
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
-
Pages with similar content: Redirect or Canonical? Or something else?
We have two pages on our site with similar content. One was originally a landing page for a marketing campaign, somewhat of a micro-site feel with a lot of content. We recently optimized another page on the site with much of the same content from the original landing page/micro-site. In order to avoid duplicate content, and to let Google know our authority page is the new page, we're wondering what is best practice: Should we... 301 redirect the old page? No index the old page? Keep both pages and use a canonical to tell Google the new page is authority? Or something else?
Intermediate & Advanced SEO | | seo_1234b0 -
If you do 302 redirect then change to 301 redirect do you lose all link juice?
Hello everyone, I was wondering if you could help me with understanding the following story: A website has been moved from its HTTP version to a HTTPS version. The SEO manager has advised developers that they needed to do 301 redirects. However, in the end, 302 redirects have been put in place instead. Now, 301s should be put in place ASAP. The million dollar question is: has the website lost all of its link juice already given the nature of the redirects? Also, does it depend on whether Google has indexed the new 302 pages or does it depend on something else? Many thanks!
Intermediate & Advanced SEO | | MarketingGH0 -
Will using 301 redirects to reduce duplicate content on a massive scale within a domain hurt the site?
We have a site that is suffering a duplicate content problem. To help resolve this we intend to reduce the amount of landing pages within the site. There are a HUGE amount of pages. We have identified the potential to reduce the pages by half at first by combing the top level directories, as we believe they are semantically similar enough that they no longer warrant being seperated.
Intermediate & Advanced SEO | | Silkstream
For instance: Mobile Phones & Mobile Tablets (Its not mobile devices). We want to remove this directory path and 301 these pages to the others, then rewrite the content to include both phones and tablets on the same landing page. Question: Would a massive amount of 301's (over 100,000) cause any harm to the general health of the website? Would it affect the authority? We are also considering just severing them from the site, leaving them indexed but not crawlable from the site, to try and maintain a smooth transition. We dont want traffic to tank. Has anyone performed anything similar? Id be interested to hear all opinions. Thanks!0 -
301 Redirected url to new subdomain, now the rank appears to be completely gone...
In an attempt to not feel bad for not blogging, I set up a new subdomain on my site to have a "coming soon" style page and "best of" section for my blog and video show properties. All the pages on the relaunch subdomain are done in Unbounce. http://relaunch.tommy.ismy.name The idea was that I would then take the pages on my regular domain, and one by one create landing pages that test out new design ideas (instead of going into full production web design) and redirect the traffic from the top ranked pages to the new, redesigned pages. At first, I set up the 301 through a plugin in wordpress and for the first week or so it was great. As far as I know, I did set my canonical tags up properly on that page too. However, just a couple days ago, I wasn't getting the same traffic, and my top ranked keyword that accounts for over half my traffic is nowhere to be found in at least the first 15 pages of search results. Which stinks, because I've maintained that rank for well over 2 years 😞 Clearly, something I did wasn't liked by Google, and I wonder, what did I do "wrong" and is there anything I could do to get that rank back?
Intermediate & Advanced SEO | | Thomas_m_walker0 -
301 Redirect htaccess
Hi Guys, I have a website that has plenty of links with parameters. For example:
Intermediate & Advanced SEO | | UrbanMark
http://www.domainname.co.uk/index.php?app=ecom&ns=catshow&ref=Brandname-Golf-Shorts&sid=201v04gxs2hlozv161tfo43qk98583el I want to place a wildcard redirect on the .htaccess but don't know what exactly code for this. Ideally I want the URLs above to be: http://www.domainname.co.uk/Category/Brandname-Golf-Shorts Any help pls. Thanks,
Brucz0 -
How long for a 301 redirect to pass PR?
Hi, How long does it take for a 301 redirect to pass PR/Juice to the new domain it's redirecting to? From what I understand you tell Google in Webmaster tools this domain is now going to this domain and then setup a file on the old domains hosting to redirect to the new. And that's it! If that is correct how long does it take? 2 days, 2 weeks, months, maybe never??? Cheers
Intermediate & Advanced SEO | | activitysuper0 -
Duplicate content even with 301 redirects
I know this isn't a developer forum but I figure someone will know the answer to this. My site is http://www.stadriemblems.com and I have a 301 redirect in my .htaccess file to redirect all non-www to www and it works great. But SEOmoz seems to think this doesn't apply to my blog, which is located at http://www.stadriemblems.com/blog It doesn't seem to make sense that I'd need to place code in every .htaccess file of every sub-folder. If I do, what code can I use? The weirdest part about this is that the redirecting works just fine; it's just SEOmoz's crawler that doesn't seem to be with the program here. Does this happen to you?
Intermediate & Advanced SEO | | UnderRugSwept0 -
Canonical tag question
Suppose a site has two pages ( Page A ) and Page B. Both of them have pagerank, but duplicate content. The page A is ranked for keyword "seo india" and page B is ranked for keyword "seo services". If i implement canonical tag on page B, does 1. The pagerank of page B will be transfered to Page A ? 2. Does the site A now ranks for keyword "seo servicies " ( for which Page B was ranking earlier )
Intermediate & Advanced SEO | | seoug_20050