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
-
Temporary Domain Changes
Hi All, Our development team needs to do a temporary site name change from www.sitename.com to new.sitename.com and then wants to return to www.sitename.com. They need to do this for the whole site due to how it's built with single sign on (SSO) and how certain post login pages utilize pre login pages and need to keep people logged in. This process is changing with a CMS upgrade and website and post login pages will be independent of the pre login pages moving forward. My question is what is the best way to manage this transition? Right now it seems like the best solution I've been able to work out with development is to reduce the domain shift down to one week and use 302 Redirects, don't index the new.sitename.com site, and for that week and take my lumps as they come from search. Looking for any other suggestion that may help marketing work with dev without casting blame on any teams for drops in organic traffic.
Intermediate & Advanced SEO | | dapacifi0 -
301 Redirect and Loss of PA and DA
Mozzers, http:itsgr82bme.com Old domain homepage had a DA of 24 and a PA of 36 Currently redirected to http://thekidstime.com Homepage shows a DA of 6 and a PA of 1. That is a significant loss of authority. I thought a 301 is supposed to be better than that. What gives? What are the next steps, asking the old backlinks to update their links? Thanks for your help, Matt
Intermediate & Advanced SEO | | matt.nails0 -
Redirecting Old Websites to New Websites
Hi Everyone, We are about to take down a number of websites in favour of a new singular B2B hub and would be looking to redirect all of these sites to the new home. For SEO purposes, what would be the best way to do this? Due to the difference in setups and scale of the site, it would be difficult to correctly match up each page to page between the sites for individual 301 redirects. Could someone advise on the best plan of action? Thanks.
Intermediate & Advanced SEO | | chbiz0 -
Multilingual Redirection
Hey there awesome Mozzers, I have a site that it automatically redirects people by using geolocation ( i know that probably is not good ) to the various languages of the site. I just wanted to know Is 301 or 302 the best option? ( I've heard that for language re-directions 302 is the best case scenario ) My main page for example is www.example.com and it automatically redirects with a 301 to www.example.com/en for any language that is not there. What is the best case scenario? Leave it to redirect to /en or just leave it go to the root page www.example.com.
Intermediate & Advanced SEO | | Angelos_Savvaidis0 -
Multiple 301 Redirects on the same domain name
Hi, I'd appreciate some advice ont he below. I have a website, say www.site.co.uk that has just been redesigned using a new CMS. Previously it had URLs in the format /article.php?id=123, the new site has more friendly urls in the format /articles/article-slug. I have been able to import the old articles into my CMS using the same article IDs and I have created a unique slug for each post. So now in my database, I have the article id (from the querystring) and a slug. However, I have hundreds of old URLs indexed by Google in the format /article.php?id=123 and need to redirect these. My plan was to do the following. 301 Redirect /article.php?id=123 to an intermediate page, in this case /redirect/123. On this intermediate page I would do a database lookup for the article slug, based on the ID from the querystring, create a new URL and perform a second 301 redirect to my new URL E.g. /articles/article-slug-from-database. Whilst this works and keeps the site usable for visitors the two 301 redirects do worry me, as I don;t want Google indexing lots of /redirect/[article id] urls. The other solution is to generate hundreds of htaccess redirect rules that map old url to the new url. The first solution is much cleaner, but the two 301's worry me. Will Google work this out on it's own, is there a better way? Any advice is much appreciated. Cheers Rob
Intermediate & Advanced SEO | | AmyCrompton1 -
How to decide on which site to 301 redirect
Hi there I'd like your opinions please! My client currently has their website at not-very-good-url.it which has a really good link profile they also have duplicate sites at: much-better-brand-name-url.it and much-better-brand-name-url.com but both these other sites have only a handful of links in. How important do you think a better brand url is? And therefore do you think it would be better to 301 to a better brand URL and take the risk that the link profile will get hit? Or leave the main site where it is and 301 the other two to it? Many thanks
Intermediate & Advanced SEO | | Chammy0 -
Seeking Help with Domain Acquisition Redirect Strategy
My company is purchasing www.boughtsite.com. This new site has multiple sub-domain sites: customsite1.boughtsite.com, customsite2.boughtsite.com, etc. 1. Is it possible to redirect everything from www.boughtsite.com to www.mycompanysite.com while leaving the other sub-domain sites active? These other sites have different audiences than our main site. 2. Would it be an okay solution to just place a link on boughtsite.com to mycompanysite.com telling visitors "We have been re-branded to My Company" 3. Can I use an i-frame to move customsite1.boughtsite.com to www.mycompanysite.com/customsite1 instead? Thanks for your input!
Intermediate & Advanced SEO | | pbhatt0 -
How to use modrewrite to redirect certain portions of a site
Hello! My question is as follows: Suppose there is SiteA which is a blog that has a url structure of http://www.siteA.com/blog/category/article Now suppose I'd like to redirect those articles to a new domain (which has the same url structure) BUT excluding a certain category, say, 'blah/' so in other words, some examples: http://www.siteA.com/blog/shoes/best-shoes-to-buy ->redirects-> http://www.siteB.com/blog/shoes/best-shoes-to-buy/ (there is a trailing slash here for some reason) BUT http://www.siteA.com/blog/blah/foo-bar -NO REDIRECT- (because it's in the /blah/ category). Any and all feedback & help would be much appreciated 🙂 Thanks!~
Intermediate & Advanced SEO | | apo11o1770