Temporary Redirects on Magento
-
I've recently taken over a client who uses the Magento platform and there was definitely a duplicate issue with his homepage. It redirected www to non www, however the canonical tag was setup wrong and pointing to the www version.
When I looked at OSE for both versions the non www has only 7 linking domains and a page authority of 32. The www version has 24 linking domains and page authority of 39. As the domain is fairly new, I decided to redirect the non www to www and keep the canonical the same. (I changed the internal linking structure etc).
When I run both URLs through this tool: http://www.ragepank.com/redirect-... it's returning a whole bunch of 302, rather than 301 redirects. What's the deal with that? Is that a Magento setting that I can fix or something a little harder?
I'm not sure if it's proper etiquette to post the URL of a client, so if that would help and is OK, please let me know.
Thanks
-
Been looking for this for ages.
Thanks
-
Wouldn't call myself an expert by any stretch, however, I've have set up and still run a few Magento stores.
The reason I asked which version your site is running, is because I believe they rolled out the 301 option in version 1.4.2.0 (based on the release notes I checked). Definitely strange you don't see it when using version 1.5.1.0.
You can solve it instead, as you rightly point out, using a rewrite rule in .htaccess, like the second extra rule from the Creare article:-
RewriteCond %{http_host} ^yourdomain.co.uk [NC] RewriteRule ^(.*)$ http://www.yourdomain.co.uk/$1 [R=301,NC]
I don't usually find I need this, because Magento solves the www issue with that 301 dropdown menu option which is missing for you.
I don't generally need the first extra rule from that article, either:-
RewriteCond %{THE_REQUEST} ^./index.php RewriteRule ^(.)index.php$ http://www.yourdomain.co.uk/$1 [R=301,L]
When I switch on Web Server Rewrites in the Magento backend, and correct the Magento root (if necessary) in .htaccess, as described in that article, the removal of index.php from URLs is usually solved. If you do still have the index.php problem, however, you could solve it in .htaccess too.
I'm definitely not an apache/mod_rewrite expert so I can't vouch for the syntax necessarily, however it certainly looks correct.
If I were you (or your client), I'd also want to get to the bottom of why I don't see that 301 option in Magento, as it could be symptomatic of an incomplete upgrade in the past. It could of course, be something else obvious which I'm missing - definitely worthy of further investigation though.
-
Hi Neil,
1.5.1.0.
Do you have much experience in rewriting htaccess files for Magento? I assume this article pretty much sums it up?
http://www.crearegroup-ecommerce.co.uk/blog/e-commerce-seo/htaccess-rewrites-for-magento-shops.php
Cheers
-
Hey Brad.. that is strange. I guess the next logical question would be which version of Magento is the site running?
-
Haha I only have two options (Yes or No):
| <label for="web_url_redirect_to_base">Redirect to Base URL if requested URL doesn't match it</label> | I.e. redirect from http://example.com/store/ to http://www.example.com/store/ |
-
You should have three options in that dropdown.. No, Yes (302 Found), and Yes (301 Moved Permanently). 301 should be the third option on the list.
-
Hi Neil,
Thanks for the superfast answer, appreciate it.
OK I switched that option from Yes to No. This fixed the temporary redirect problem. However, now both the www and non www versions are returning a 200 response (see http://www.ragepank.com/redirect-check/).
Is this an easy fix in Magento? I know in other systems such as Volusion we don't have access to htaccess. I'm guessing I can't do anything about this and I just have to worry about setting up the correct canonical?
Thanks
-
Hey Brad.. firstly, posting client URLs is fine as far as SEOmoz Q&A is concerned, however, it's entirely up to you in terms of client privacy.
Magento has a setting in the back-end for solving www/non-www canonicalisation (System > Configuration > Web > URL options). You'll see a setting for redirect type ("Auto-redirect to Base URL"), and obviously you'll want to ensure it's set to 301 rather than 302.
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
-
Redirect old image that has backlinks
Hi Moz Community! I'm doing an audit of a website and did a backlink analysis. In the backlink analysis, there is an image that has 66 backlinks but the image doesn't exist on the website anymore (it was on a website that was created in 2011 - 2 web launches ago). I don't believe a 301 redirect will work for an image that doesn't exist anymore. How would I redirect the image URL (it's WordPress so we have a specific URL that other websites are linking to but get 404 errors) without going to each individual website and requesting they change the URL link? Any advice or recommendations would be great. Thanks!
Intermediate & Advanced SEO | | BradChandler1 -
301 Redirection
Hi there guys, I have a question about redirection. My boss has just bought a new domain name and he wants it to redirect to our current site when looking for specific products. www.example.com is our current website www.productname.com is the new domain So the new domain would be redirected to example.com. Would that be considered against Google Policies? Thanks
Intermediate & Advanced SEO | | PremioOscar0 -
Cannot 301 redirect, alternatives?
Hi, the company has changed it's name so now under a different domain. All pages have been 301 redirected on a 1:1 basis apart from the home page. For some reason IT cannot 301 redirect the old home page to the new website home page. At suggestions? Perhaps canonical it? Meantime the old home page copy has been changed to say the company name has changed and a link to the new website. Any help greatly appreciated.
Intermediate & Advanced SEO | | Richard5550 -
Redirect one store to another...
Here's the situation: 2 online stores. Store A is doing really well, traffic, sales, and keyword ranking wise. Store B, not so much. Owner wants to redirect all links from store B to store A and then possibly re-brand store A and give it a different URL. This is a slow time, sales pick up in spring. I would like opinions on this from anyone who has done this or knows about it. Risks, benefits, best practices on going about it, etc... Thank you, Lisa
Intermediate & Advanced SEO | | Freelancer130 -
Old page redirection method ?
New web site uploaded .but still there are many old site's pages index in Google .I have created 301 redirect for similar page but what about rest of pages?as eg there is a page called www.xxxx.com/testimonial.php but new site don't have a testimonial pages so what i can delete old page and redirect to home page or what please advice me
Intermediate & Advanced SEO | | innofidelity0 -
Explaining 301 redirects instead of 302
I am trying to explain in layman's terms to a client why using 302 for their redirects (which they have done themselves) is not right. There view is they do not seem to listen or believe what is being said to them and do not want to do permanent damage to the old domain so are using 302 redirects. I have explained over and over 301 is needed but I do not seem to be good at communicating this. Can someone give me a good example or description I can use to get my point across?
Intermediate & Advanced SEO | | JohnW-UK0 -
How to do a 301 redirect for url's with this structure?
In an effort to clean up my url's I'm trying to shorten them by using a 301 redirect in my .htaccess file. How would I set up a rule to grab all urls with a specific structure to a new shorter url examples: http://www.yakangler.com/articles/reviews/other-reviews/item/article-title http://www.yakangler.com/reviews/article-title So in the example above dynamically redirect all url's with /articles/reviews/other-reviews/item/ in it to /reviews/ so http://www.yakangler.com/articles/reviews/boat-reviews/item/1550-review-nucanoe-frontier http://www.yakangler.com/articles/reviews/other-reviews/item/1551-review-spyderco-salt http://www.yakangler.com/articles/reviews/fishing-gear-reviews/item/1524-slayer-inc-sinister-swim-tail would be... http://www.yakangler.com/reviews/1550-review-nucanoe-frontier http://www.yakangler.com/reviews/1551-review-spyderco-salt http://www.yakangler.com/reviews/1524-slayer-inc-sinister-swim-tail with one 301 redirect rule in my .htaccess file.
Intermediate & Advanced SEO | | mr_w0 -
Trailing Slash: Lost in Redirection?
Question here, but first the lead in. As you all know, 301 redirects don't pass on 100% of link juice. I've set up my site using htaccess to redirect all non-ww to www and redirect all URLs to have a trailing slash. FYI, the preferred domain is selected in WMT and canonical URLs appear in the head section of all pages. So now what happens when sites that link to mine don't include either the www or the trailing slash, which is actually quite common? Of course, asking the site own to correct the link is ideal, but that's not always possible. So if thousands of links on external sites are linking to http://www.site.com instead of http://www.site.com/, won't lots of link juice get lost in redirection? I can't think of anything more I can do to the URLs to reduce duplicate content and juice dilution. Thoughts? Kevin
Intermediate & Advanced SEO | | kwoolf0