Redirecting Canonical 301s and Magento Website
-
I have an issue with a client's website where it has 3700+ pages, but roughly half of them are duplicates. Thankfully, the only difference between the original and the duplictes is the "?print" at the end of each URL (I suppose this is Magento's way of making a printable page version of the same page. I don't know, I didn't build it.)
My questions is, how can I get all the pages like this
http://www.mycompany.com/blah.html?print
to redirect to pages like this...
http://www.mycompany.com/blah.html
Also, do they NEED to be Canonical, or will a 301 redirect be sufficient.
Also, after having done this, if anybody knows, is there a way I can turn that feature off in Magento, because we're expanding our product line, and I don't want to have to keep chasing after these "?print" pages after the fact.
-
Late to this game, but just in case you're still waiting on your dev...
Magento has an automated add-on system called Magento Connect, and you can access it from your admin (unless the original installer disabled it on your account). You can just use that to install Yoast's plugin. Check out http://www.magentocommerce.com/magento-connect/canonical-url-for-magento.html
Aside from that, if you are using something after 1.4, you should have canonical built into your store (it's in the config section).
If you're not using something after 1.4, consider upgrading. It's not painless, but anything prior to 1.4.1 is pretty rough to use. I'm not surprised you've got bugs and general sadness.
-
Hehe, hey now, not all us developers are lazy
You know your system better than any of us do. My 1. and 2. are just the best-case order in which to get things done. Do what works for you and your site.
-
like I said, I will email your solution concerning the plugin to my web admin guy, but the reason why I'm kind of reticent to do that is it's more a matter of bureacracy (to be sensitive to his time constraints) rather than technical or lack of know-how. I want to get it done right, but I also want to get it done in a timely manner. But I will forward this to him. Thanks you sir.
-
I don't understand why you don't just use the rel="canonical" plugin I mentioned above... ?
-
thank you sir....I'll try to avoid the htaccess route then.
-
Yeah I guess this is the only way to go. Now I just got to get the webmaster to get around to it. (sigh)...
-
Yes to your first questions. Here's the process for each (as I see it):
1. Fix/remove the ability for system to generate ?print URL's and implement canonical tags; open beer and wait 'til search engines sort things out. Nothing more you can do here.
2. No fix to system so we still have ?print URL's. In this case, setup the 301's in your .htaccess file; however, as long as the system is still generating these ?print URLs, you will have to keep the redirects in the .htaccess in tact, permanently.
Untested:
RewriteEngine On
RewriteBase /
RewriteRule ^([^/]*).html?print$ /$1.html [L,NC,R=301]
-
I guess my question now is, just doing the htaccess route is a bad idea? in both 301s AND canonicals or just 301s? I guess I'm not looking for easy, but economical. Thanks for your responses.
-
I agree with THB on this, use rel="canonical" you simply want to say to the search engines "Hey this is the preferred URL for my content".
301's are for saying "Hey this page has permanently moved to a new page/site"
I would use the rel="canonical" plugin I posted for you above, it will automatically add the canonical tag for you, job done.
-
Yeah, I know, right. The problem is, I found this out only AFTER I bought the PRO version and mapped out the entirety of the site. Some of those ?print URLs are now indexed in the SEs. So I agree with nipping this problem in the bud (or the root, whichever one prefers), but I still need to know how to do it via the htaccess. In other words, I have to go backwards and take care of the rankings, THEN figure out how to turn it off (and I can go to the Magento forums for that).
-
So, assuming this works, can I eventually remove the ".html?print" versions of the pages after the SEs have changed the URLs in their indices?
also, I'm not getting the impression it's going to save me time on specifying different pages (it may save time, I'm not sure), but in the chance it doesn't or the plugin fails to do as advertised, what is the htaccess option for this? Because at least, in this case, I can see the immediacy in it AND you can do canonical rewrites FROM the htaccess.
My situation is, I'm not THAT advanced in wildcards to make this happen (otherwise, I'd do it myself via just trial and error until it works) AND I myself don't have access to the site (the webmaster does, whose part time) and I have a choice between "Hey, here's several (or one line) of code to put into htaccess to resolve this problem" OR "can you go through and implement this plug to do the Canonical redirects on every page, oh and by the way, please back up first."
So it's not merely JUST a technical problem or a know-how problem, it's also a bureaucratic problem that can mean the difference between getting it done in a few minutes, and it could take two weeks to make happen depending on this person's perception.
-
Just to clarify. If there is in fact no difference between the pages (as you originally stated), then please just use the canonical tag. As much as you might want to setup 301 redirects, they would not be the way to go in this case. Trust me.
Otherwise, here is what I would do, honestly: find out why the ?print is causing information to be displayed improperly in some cases. If it's accessing the same db tables using the same queries, then that shouldn't be happening. I'd fix that, and implement the canonical tags, and wait it out. That would be the easiest approach and most beneficial with the least impact to your site and any rankings.
If this is something your not capable of fixing (not sure if you're proficient with coding, etc), then you can setup 301's as a 'hack', but they should not be left in permanently as the process in which I stated just above is the best way to resolve the issue.
In order to assist you with any .htaccess markup, you'll need to provide some examples of your URL's, and whether they have any common identifiers.
-
OK - I was basing my answers on what you said, "the only difference between the original and the duplictes is the "?print" at the end of each URL"
If there is in fact different content on each page, and the ?print page is the one with the errors, then you should remove the ability for ?print pages to even be generated in the first place instead of having them constantly redirecting user/bots. Forever 301 re-directions can hurt you down the road.
Once you've removed the ability for users/bots to find and access the ?print pages, then setup the 301's and insert the canonical tags.
-
It looks like this plugin will add the rel="canonical" tag for you automatically: http://yoast.com/tools/magento/canonical/
View the source code after you have installed it to confirm it's working as expected.
-
I was answering this Kjay's response while this one was coming down the pipeline. I get you on the fact if they were TRULY identical, but the reason I wanted to do the 301s is because more than likely, the Magento engine is faulty, and I've found situaitons where the prices are different between the two versions, or the images and text haven't been updated, etc. etc., hence, the need for a 301
-
I guess my question is, if I use JUST the canonical, then the SEs will get around to changing the address, but will still go to the "?print" pages until that time.
Also, the Magento help aide on that said I had to do it with EACH individual page. It's going to be especially time-consuming to have to go back out into the admin, go back into the admin, and check to see EVERY time the page that I'm canonizing is the right html version. I think this is where accessing the htaccess will save me a bunch of time (I still have to change the title tags on the remaining original 1500 pages, as well as find out from the Magento site, to access the H1 tags in the templates).
If I use the basic 301 redirect, I get the benefit of the immediate redirect, but I fail to see the downside of having to "endure" the 301 redirect other than additional rules for the browser to access the server. I eventually want to get RID of these "?print" pages because I'm getting the feeling that prices won't update as reliably on the ".html?print" version of the pages, update images (which we HAVE had trouble with in the past) etc. etc. And there's also the possibility that people may still access those ?print pages even if I did just do a canonical. It's just better to admin and SEO 1500+ pages as opposed to 1500+ pages and their duplicates.
I guess, what I'm looking for is, more than likely, the syntax command that's going to include a wildcard function to accomodate everything between "http://www.mycompany.com/" and ".html?print" or ".html". What would that look like?
-
Agreed
-
Ya, this is what I was talking about. Just a standard canonical html tag inserted into the framework.
That will clear everything up for you (might take a wee bit, but Google will recognize it right away).
No need for .htaccess whatsoever since the content is identical. If the content were different, ie. the ?print page showed a completely different style format, then sure, setup some 301's to get the user's to the right page. But not needed for your situation.
-
I would just add:
rel="canonical" href="http://www.mycompany.com/blah.html" />
No need to add 301's.
This might be useful it's Magento specific: http://www.magentocommerce.com/wiki/adding_canonical_url_to_cms_pages
-
Okay, so if I were in the htaccess file, what would it look like?
would it be a Query string rewrite?
RewriteEngine On
_ RewriteBase /_
RewriteCond %{QUERY_STRING} ^(*)$
RewriteRule ^()html?print$ http://www.mycompany.com/()html$ [R=301]
or just a straight one line redirect
Redirect 301 /()html?print http://www.mycompany.com/().html
-
Canonical will suffice as it is basically a 301 anyways. Cleaner too as there is no actual redirect for the user, or bot, to endure.
You can also set it up in Google Webmaster Tools under 'Site Configuration > URL Parameters' to ignore that parameter; however, using the canonical tag will more than suffice in this case.
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
-
Canonical's, Social Signals and Multi-Regional website.
Hi all, I have a website that is setup to target different countries by using subfolders. Example /aus/, /us/, /nz/. The homepage itself is just a landing page redirect to whichever country the user belongs to. Example somebody accesses https://domain/ and will be redirected to one of the country specific sub folders. The default subfolder is /us/, so all users will be redirected to it if their country has not been setup on the website. The content is mostly the same on each country site apart from localisation and in some case content specific to that country. I have set up each country sub folder as a separate site in Search Console and targeted /aus/ to AU users and /nz/ to NZ users. I've also left the /us/ version un-targeted to any specific geographical region. In addition to this I've also setup hreflang tags for each page on the site which links to the same content on the other country subfolder. I've target /aus/ and /nz/ to en-au and en-nz respectively and targeted /us/ to en-us and x-default as per various articles around the web. We generally advertise our links without a country code prefix, and the system will automatically redirect the user to the correct country when they hit that url. Example, somebody accesses https://domain/blog/my-post/, a 302 will be issues for https://domain/aus/blog/my-post/ or https://domain/us/blog/my-post/ etc.. The country-less links are advertised on Facebook and in all our marketing campaigns Overall, I feel our website is ranking quite poorly and I'm wondering if poor social signals are a part of it? We have a decent social following on Facebook (65k) and post regular blog posts to our Facebook page that tend to peek quite a bit of interest. I would have expected that this would contribute to our ranking at least somewhat? I am wondering whether the country-less link we advertise on Facebook would be causing Googlebot to ignore it as a social signal for the country specific pages on our website. Example Googlebot indexes https://domain/us/blog/my-post/ and looks for social signals for https://domain/us/blog/my-post/ specifically, however, it doesn't pick up anything because the campaign url we use is https://domain/blog/my-post/. If that is the case, I am wondering how I would fix that, to receive the appropriate social signals /us/blog/my-post/, /aus/blog/my-post/ & /nz/blog/my-post/. I am wondering if changing the canonical url to the country-less url of each page would improve my social signals and performance in the search engines overall. I would be interested to hear your feedback. Thanks
Intermediate & Advanced SEO | | destinyrescue0 -
Bing seriously hitting our website
Hi I have a strange query, Bing in the last four weeks have been seriously crawling our site, and while at the moment this isn't affecting our servers, coming into the busy time of the year I am just wondering if anyone else is seeing this. They are basically crawling the entire site (including nofollow pages) even though according to Bing Webmaster tools, they know our sitemap. Is anybody else seeing any unusual activity with the Bing bot. Thanks Andy
Intermediate & Advanced SEO | | Andy-Halliday0 -
Am I missing an issue on my website?
Are there any glaring issues that I am missing with my site? I am building links, and growing the profile but had seen a drop in rankings a couple of months ago. Is this do to a site issue or am I just missing something? www.wallybuysell.com Any help would be great.
Intermediate & Advanced SEO | | CKerr0 -
Same website, seperate subfolders or separete websites? 12 stores in two cities
I have a situation where there are 12 stores in separate suburbs across two cities. Currently the chain store has one eCommerce website. So I could keep the one website with all the attendant link building benefits of one domain. I would keep a separate webpage for each store with address details to assist with some Local SEO. But (1) each store has slightly different inventory and (2) I would like to garner the (Local) SEO benefits of being in a searchers suburb. So I'm wondering if I should go down the subfolder route with each store having its own eCommerce store and blog eg example.com/suburb? This is sort of what Apple does (albeit with countries) and is used as a best practice for international SEO (according to a moz seminar I watched awhile back). Or I could go down the separate eCommerce website domain track? However I feel that is too much effort for not much extra return. Any thoughts? Thanks, Bruce.
Intermediate & Advanced SEO | | BruceMcG0 -
Website Is In Tables
Our website www.accupos.com is mainly created with TABLES, which I've heard is a practice from Neanderthal times. Nevertheless, it is my job as the new Dir. of Marketing to SEO the hell out of it. Would you recommend converting the ENTIRE website into Divs or changing the current Tables situation? Or is this not a big deal for SEO? The site APPEARS fine, but I want to get our keywords ranked as well as possible, putting my time in the most efficient places (like link building!). How much of a high priority might this Tables fix be? We are also running an AdWords campaign spending LOTS every month. Please Moz me! Derek
Intermediate & Advanced SEO | | DerekM880 -
Why would the PageRank for all of our websites show the same?
The last time I checked (early this year), the PageRank on the sites I manage varied, with the highest showing as 6. It made sense as the PR6 site has loads of links and has been around for a long time, whereas the other sites hadn't. Now all of our websites are showing the same PageRank - 6, even one that has recently launched and another that has barely any links/traffic or anything to it. I didn't check the PR of that one last time (I'd be surprised if it was 2), but the sites now showing as 6 ranged from PR3 to PR6 back then. We changed server in February...so could this issue be something to do with all of the sites being stored on the same server? It doesn't seem right but it's the only thing I can think of. At the moment, the Domain Authority for these six websites ranges from 27 to 62.
Intermediate & Advanced SEO | | Alex-Harford0 -
301 Redirect or Canonical Tag or Leave Them Alone? Different Pages - Similar Content
We currently have 3 different versions of our State Business-for-Sale listings pages - the versions are: **Version 1 -- Preferred Version: ** http://www.businessbroker.net/State/California-Businesses_For_Sale.aspx Title = California Business for Sale Ads - California Businesses for Sale & Business Brokers - Sell a Business on Business Broker Version 2: http://www.businessbroker.net/Businesses_For_Sale-State-California.aspx Title = California Business for Sale | 3124 California Businesses for Sale | BusinessBroker.net Version 3: http://www.businessbroker.net/listings/business_for_sale_california.ihtml Title = California Businesses for Sale at BusinessBroker.net - California Business for Sale While the page titles and meta data are a bit different, the bulk of the page content (which is the listings rendered) are identical. We were wondering if it would make good sense to either (A) 301 redirect Versions 2 and 3 to the preferred Version 1 page or (B) put Canonical Tags on Versions 2 and 3 labeling Version 1 as the preferred version. We have this issue for all 50 U.S. States -- I've mentioned California here but the same applies for Alabama through Wyoming - same issue. Given that there are 3 different flavors and all are showing up in the Search Results -- some on the same 1st page of results -- which probably is a good thing for now -- should we do a 301 redirect or a Canonical Tag on Versions 2 and 3? Seems like with Google cracking down on duplicate content, it might be wise to be proactive. Any thoughts or suggestions would be greatly appreciated! Thanks. Matt M
Intermediate & Advanced SEO | | MWM37720 -
Multiple 301 redirects considered a redirection chain?
I need to redirect a ton of duplicate content, so I want to try redirect 301 /store/index.php /store redirect 301 /store/product-old /store/product-new redirect 301 /store/product-old1 /store/product-new1 redirect 301 /store/product-old2 /store/product-new2 redirect 301 /store/product-old3 /store/product-new3 redirect 301 /store/product-old4/file.html /store/product-old4/new4/file.html and then a whole bunch of old dead links to homepage. So we've had /index.php redirected to / on other parts of the site for awhile, and for the most part /store is a friendly URL, but then we have tons of dup content and work arounds that preceded my job here. I'm wondering if those redirects above would be considered a redirection chain? Since the all the redirects below the /index.php -> /store count on that one redirect. Thanks for any insight you may be able to give!
Intermediate & Advanced SEO | | Hondaspeder1