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 Chain
This is quite advanced so maybe Rand can give me an answer? I often have seen questions surrounding a 301 chain where only 85% of the link juice is passed on to the first target and 85% of that to the next one, up to three targets. But how about a canonical chain? What do I mean by this:? I have a client who sells lighting so I will use a real example (sans domain) I don't want 'new-product' pages appearing in SERPS. They dilute link equity for the categories they replicate and often contain identical products to the main categories and subcategories. I don't want to no index them all together I'd rather tell Google they are the same as the higher category/sub category. (discussion whether a noindex/follow tag would be better?) If I canonicalize new-products/ceiling-lights-c1/kitchen-lighting-c17/kitchen-ceiling-lights-c217 to /ceiling-lights-c1/kitchen-lighting-c17/kitchen-ceiling-lights-c217 I then subsequently discover that everything in kitchen-ceiling-lights-c217 is already in /kitchen-lighting-c17 and I decide to canonicalize those two - so I place a /kitchen-lighting-c17 canonical on /kitchen-ceiling-lights-c217. Then what happens to the new-products canonical? Is it the same rule - does it pass 85% of link equity back to the non new-product URL and 85% of that back to the category? does it just not work? or should I do noindexi/follow Now before you jump in: Let's assume these are done over a period of time because the obvious answer is: Canonicalize both back to /ceiling-lights-c1/kitchen-lighting-c17 I know that and that is not what I am asking. What if they are done in a sequence what is the real result? I don't want to patronise anyone but please read this carefully before giving an answer. Regards Nigel Carousel Projects.
Intermediate & Advanced SEO | | Nigel_Carr0 -
Canonicals question ref canonicals pointing to redundant urls
Hi, SCENARIO: A site has say 3 examples of the same product page but with different urls because that product fits into 3 different categories e.g. /tools/hammer /handtools/hammer /specialoffers/hammer and lets say the first 2 of those have the canonical pointing to /specialoffers/hammer YET that page is now redundant e.g. the webmaster decided to do away with the /specialoffers/ folder. ASSUMPTIONS: That is going to seriously hamper the chances of the 2 remaining versions of the hammer page being able to rank as they have canonicals pointing to a url that no longer exists. The canonical tags should be changed to point to 1 of the remaining url versions. As an added complication - lets say /specialoffers/hammer still exists, the url works, but just isn't navigable from the site. Thoughts/feedback welcome!
Intermediate & Advanced SEO | | AndyMacLean0 -
Worth it to redirect .swf during a website migration?
Recently one of our clients switched web providers. We've been implementing 301 redirects to the new URL structure for the most important pages. We noticed upon doing a site search, Google has indexed a .swf URL on page 3 of search results. Please see attached image. 1. Should I implement a redirect for this? There are no links to this filetype.
Intermediate & Advanced SEO | | EEE3
2. There are three others (.swf) that are indexed I would think the best thing to do is to have the new website return a 404 for this page, as it's currently doing, and it will eventually drop out of the index. Any other suggestions? Thanks! g2tur4r0 -
301s from previous site
Hi! Got quite a tricky problem regarding a client, http://www.muchbetteradventures.com/ and their previous site, http://v1.muchbetteradventures.com/ Here's the background: We have approx 1500 'listing' pages like this: http://v1.muchbetteradventures.com/listing/view/1925/the-barre-des-ecrins-or-the-dome-des-ecrins-mountaineering-trip They bring in min 2k hits/month, and also add to the overall site authority I suspect. They will eventually all have a home on main domain. When they do, they will also each have been rewritten to be unique, so the value of them will increase (many are currently not). We also have landing pages like this: http://v1.muchbetteradventures.com/view/559/volunteering-holidays- which despite being hideous are ranked fairly well (page 1 for key terms). We cannot currently fulfil all these on main domain, but do not want to shut them down and lose positioning. Choices as I see it: Make a landing page e.g. muchbetteradventures.com/volunteering and a) redirect from old landing page, b) redirect all related 'listings' to this page. May help preserve rankings of main landing page (the most important), but not of any listings? Import all listings to have a home on main domain, (probably as children of a landing page, but not rewritten to be unique just yet). Make them not accessible from homepage, and change functionality of them so that new visitors from google are told we cannot currently help them with this trip. This is more work to complete so will take longer to do and is a distraction from our core focus so needs good justification! Stay running largely as we are, slowly redirecting 1 page at a time as we carry over more and more options to main domain. This will take over 12 months min.
Intermediate & Advanced SEO | | neooptic0 -
Does Having 3 Websites On Magento Affect Domain Authority?
We have a client who has 3 separate websites targeting the US, Australia, and the UK. Each of them has relevant ccTLD's such as: .com .com.au and .co.uk. Our client wants to use the Magento multi-site function so it combines all the stores (which are the exact same products) and merge it into one through Magento. Will this affect his Domain Authority? Or would they be treated as individual when receiving link value, trust, authority? There doesn't seem a lot information out there about this can anyone help? Thanks, Matt
Intermediate & Advanced SEO | | HigherthanSEO0 -
Is it ok to use both 301 redirect and rel="canonical' at the same time?
Hi everyone, I'm sorry if this has been asked before. I just wasn't able to find a response in previous questions. To fix the problems in our website regarding duplication I have the possibility to set up 301's and, at the same time, modify our CMS so that it automatically sets a rel="canonical" tag for every page that is generated. Would it be a problem to have both methods set up? Is it a problem to have a on a page that is redirecting to another one? Is it advisable to have a rel="canonical" tag on every single page? Thanks for reading!
Intermediate & Advanced SEO | | SDLOnlineChannel0 -
Duplicate titles but redirecting anyway (without redirects set up!!!)
Google has done a crawl of my site and is flagging up duplicate titles on my wordpress site. This appears to be due to the face that some posts are tagged in more than one category. I have just gone to make sure that each post just has one category and add redirects and I've noticed that all the duplicate title issues google has notified me about appear to redirect anyway. For example: http://www.musicliveuk.com/latest-news/live-music-boosts-australian-economy and http://www.musicliveuk.com/live-music/live-music-boosts-australian-economy have duplicate titles apparantly but the 1st url redirects to the 2nd one. I use the redirection plug in but have no redirection set up for that url so I'm a bit confused. And if they're redirecting anyway then why is google flagging up duplicate titles? Any help would be much appreciated.
Intermediate & Advanced SEO | | SamCUK1 -
To "Rel canon" or not to "Rel canon" that is the question
Looking for some input on a SEO situation that I'm struggling with. I guess you could say it's a usability vs Google situation. The situation is as follows: On a specific shop (lets say it's selling t-shirts). The products are sorted as follows each t-shit have a master and x number of variants (a color). we have a product listing in this listing all the different colors (variants) are shown. When you click one of the t-shirts (eg: blue) you get redirected to the product master, where some code on the page tells the master that it should change the color selectors to the blue color. This information the page gets from a query string in the URL. Now I could let Google index each URL for each color, and sort it out that way. except for the fact that the text doesn't change at all. Only thing that changes is the product image and that is changed with ajax in such a way that Google, most likely, won't notice that fact. ergo producing "duplicate content" problems. Ok! So I could sort this problem with a "rel canon" but then we are in a situation where the only thing that tells Google that we are talking about a blue t-shirt is the link to the master from the product listing. We end up in a situation where the master is the only one getting indexed, not a problem except for when people come from google directly to the product, I have no way of telling what color the costumer is looking for and hence won't know what image to serve her. Now I could tell my client that they have to write a unique text for each varient but with 100 of thousands of variant combinations this is not realistic ir a real good solution. I kinda need a new idea, any input idea or brain wave would be very welcome. 🙂
Intermediate & Advanced SEO | | ReneReinholdt0