Canonical / 301 Redundancy
-
Suppose I have two dynamic URLs that lead to the identical page:
www.example.com/product.php?x=1&y=1
and
www.example.com/product.php?y=1
The x=1 parameter had some historical meaning, but is now unused. All references to the x=1 parameter have been removed from internal links and sitemaps.
I have implemented two solutions:
First, the header of www.example.com/product.php?x=1&y=1 includes:
Second, the .htaccess file includes the following:
Redirect permanent /product.php?x=1&y=1 http://www.example.com/product.php?y=1
Questions:
1. I assume that since canonical is still relatively new, it's best to play it safe and implement both solutions. Is this correct?
2. When I point my browser to www.example.com/product.php?x=1&y=1, it does NOT redirect to www.example.com/product.php?y=1. The address bar continues to show the non-canonical URL. Is this because the canonical tag somehow takes precedence over the 301 redirect?
3. How long will Google Webmaster Tools continue to show these as duplicates, even though I've implemeted BOTH canonical and 301? It's been a few weeks and I thought it would have rolled off by now.
Thanks!
-
Note to self, and to others who see this thread later, the 301 for this situation is:
RewriteCond %{QUERY_STRING} x=([0-9]+)&y=([0-9]+)
RewriteRule ^product.php$ http://www.example.com/product.php?y=%2 [r=301,nc]
-
Dr. Pete,
Thanks for the very helpful answer. I've gotten rid of the rel-canonical tag for this part of the site and I'll try to figure out what's up with the 301s.
BTW, I listened to the recorded version of your "future proofing" webinar this morning and learned a lot.
Akira
-
(1) Honestly, I tend not to double-up, if for no other reason that you can't really tell what's work and what isn't. Keep in mind, too, that these tools do have different purposes. 301-redirects impact everyone (users and bots), whereas rel-canonical is only for search. If a 301 is appropriate, then just use a 301.
(2) If the address bar isn't changing, your 301-redirect isn't working. Test it with a header checker:
http://tools.seobook.com/server-header-checker/
A rel-canonical tag will not override browser behavior (at least, not at this point in time).
(3) It can take weeks to clear, and it sounds like your 301 isn't working right, so that's going to exacerbate the problem. The page has to re-crawl and re-cache, and GWT may still show the message for a couple of weeks after that.
Personally, I'd drop the canonical and fix the 301-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
-
Mass 301 redirect in htaccess
I use ScreamingFrog to generate sitemaps for my Magento 2 multistore, but I recently noticed two issues. Each category/page has two URLs. One with / and the end and one without. Every product has two URLs. One with /product-name and the other /shop/product-name. The URLs are canonicalised, but this is still a problem and I'm not sure exactly how to execute this in the htaccess file. So I need to: Remove all URLs without the / at the end and redirect them all to the URL with / at the end. Or vice versa. 301 redirect every single product (there are over 400) from shop/product-name to /product-name. How do I do this en mass in the htaccess file?
Intermediate & Advanced SEO | | moon-boots0 -
301 redirection help needed!
Hi all, So if we used to have a domain (let's say olddomain.com) and we had a new site created at newdomain.com how do we properly setup redirects page to page. Caveat, the urls have changed so for instance the old page oldomain.com/service is now newdomain.com/our-services on the new site. Do we need to have hosting on the old site? Do we need to setup individual 301s for each page corresponding to the new page? Just looking for the easiest way to do this CORRECTLY. Thanks, Ricky
Intermediate & Advanced SEO | | RickyShockley3 -
Canonical Confusion
So I have products appearing in several categories, all of which have the correct canonical url. But Moz is flagging up pages I never knew existed, and I don't understand why they exist at all and more so why my canonical fix isn't occurring for them, as below: SEO Friendly URL: http://thespacecollective.com/nasa-pin-sets/nasa-shuttle-mission-pin-set-no2 Weird URL to same product: http://thespacecollective.com/index.php?route=themecontrol/product&product_id=159 Is this a developer problem rather than an SEO problem?
Intermediate & Advanced SEO | | moon-boots0 -
301 redirects Ruby on Rails
Can anyone point me to the best way to implement 301 redirects on a Ruby on Rails website?
Intermediate & Advanced SEO | | brianvest0 -
301s Or Stick With Canonical?
Hello all! A nice interesting one for you on this fine Friday... I have some pages which are accessible by 2 different urls - This is for user experience allowing the user to get to these pages in two different ways. To keep Google happy we have a rel canonical so that Google only sees one of these urls to avoid duplicates. After some SEO work I need to change both of these urls (on around 1,000 pages). Is the best way to do this... To 301 every old url to every new url Or... To not worry as I will just point the indexed pages to the new rel canonical? Any ideas or suggestions would be brilliant. Thanks!
Intermediate & Advanced SEO | | HB170 -
Scanning For Duplicate Canonical Tags
I'm looking for a solution for identifying pages on a site that have either empty/undefined canonical tags, or duplicate canonical tags (meaning the tag occurs twice within the same page). I've used Screaming Frog to view sitewide canonical values, but the tool cannot identify when pages use the tag twice, nor can it differentiate between pages that have an empty canonical tag and pages that have no canonical tag at all. Any help finding a tool of some sort that can assist me in doing this would be much appreciated, as I'm working with tens of thousands of pages and can't do this manually.
Intermediate & Advanced SEO | | edmundsseo0 -
301 redirect and improved ranking
I was wondering if a 301 redirect will improve my ranking. My subpages use to redirect to my homepage ( all the subpages of my site redirecting to my homepage) and my homepage use to have no redirect from non www.to www. ( other than thru google webmaster tools. I am sure why it was like this for my subpages... I was wondering if I can expect some improvements in ranking now that the redirect goes from the none www. to the www version of each subpage and not to the homepage. By the way what was the issue ( was I telling google ) by re-directing all my subpages to the homepage ? was I making google think that my subpages and my homepage were all the same ? was I sending all the link juice from the subpages to my homepage ? etc... Thank you,
Intermediate & Advanced SEO | | seoanalytics0 -
Penguin/Panda/Domain Purchase
If I move forward with the acquisition: 1. Should I, if there is a way, just acquire the domain and then attempt to unlink existing links? 2. Can I just buy the domain, completely kill the site, and then build again from scratch? Even if I do that, the links to the domain will still be out there. 3. Should I even move forward with the purchase if I know these tactics have been used? Thanks!
Intermediate & Advanced SEO | | dbuckles0