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
-
Multistore 302 Redirects
I noticed that every link on my site is being flagged up as a 302 temp redirect in Moz. The reason is because we have a multi store and use GeoIP to redirect anyone coming from their respective country. I'm guessing a 302 is the wrong way to do this - can anyone shed advice on the best practice for redirecting customers to geo-specific stores?
Intermediate & Advanced SEO | | moon-boots0 -
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 -
Several 301 Redirects to Same Page
Hi, I have 3 Pages we won't use anymore in our website. Let's call them url A, url B and url C. To keep their SEO strength on our domain, I've though about redirecting all of them to url D. For what I understand, when 301 redirecting, about 85-90% of the link SEO juice is passed. Then, if I redirect 3 URLs to the same page... does url D receive all the link SEO juices for URLs added up? (approximately)
Intermediate & Advanced SEO | | viatrading1
e.g. future url D juice = 100% current url D juice + 85% url A juice + 85% url B juice + 85% url C juice Is this the best practice, or is there a better way? Cheers,0 -
Redirect wordpress.com and internal link ?
Hi Moz Fans, First of all, I need to say thanks to all of answer to previous post. And today i also have the another question that similar to that post. Because our website using Wordpress.org as our CMS for blog post then easier to redirect by point to new site, According to setting site URL ? However in our each blog articles also have anchor text as internal link that link to another blog post, Which mean those link will be automatic redirect to new URL. So once Google bot re-crawl our website when we tell the Google by webmaster tools and the redirection we using 301. What will be happen when Google Bot crawl those link again We need to changes those link as well Keep same with redirection. Nothing happen
Intermediate & Advanced SEO | | ASKHANUMANTHAILAND0 -
Redirect HTTP to HTTPS
Hello, Simple question - Should we be redirecting our HTTP pages to HTTPS? If yes, why, if not, why? Thanks!
Intermediate & Advanced SEO | | HB170 -
301 Redirect htaccess
Hi Guys, I have a website that has plenty of links with parameters. For example:
Intermediate & Advanced SEO | | UrbanMark
http://www.domainname.co.uk/index.php?app=ecom&ns=catshow&ref=Brandname-Golf-Shorts&sid=201v04gxs2hlozv161tfo43qk98583el I want to place a wildcard redirect on the .htaccess but don't know what exactly code for this. Ideally I want the URLs above to be: http://www.domainname.co.uk/Category/Brandname-Golf-Shorts Any help pls. Thanks,
Brucz0 -
Redirect a temporary IP
I was performing some development work on a client's site recently under a temporary location on the host's server, for example: http://11.22.33.444/~accountname/folder/page.html Google managed to index a couple of pages using this url 😞 I have updated DNS to the correct domain and the site is live, but I am a bit confused in regards to the correct way to create a 301 Redirect for this example or at least a way point it to our 404 page. I am hoping someone more proficient with htaccess can help me out a bit... Thanks!
Intermediate & Advanced SEO | | SCW0 -
Warning about a 302 redirect
Hello everyone, I'm testing the pro software and recently I installed an SSL Certificate on one of the websites I'm monitoring, I put in place an .htaccess directive to force all traffic to the secure version of the site (https) and I noticed how this raised a warning because my directive is forcing the traffic with a 302 redirect. These are the lines: _RewriteCond %{SERVER_PORT} 80 _ RewriteRule ^(.*)$ https://example.com/$1 [R,L] I understand that this is not good so I figured since I'm already redirecting all www to -www I can force traffic that arrives trying to use www to the secure version like so: RewriteCond %{HTTP_HOST} !^example.com$ RewriteRule (.*) https://example.com/$1 [R=301,L] But this is not 100% effective because if someone visits the site directly on the -www version this person wont get redirected hence it wont be forced to see the https. So my question is: does anybody know of an alternate way to force traffic to the secure socket using a 301 instead of a 302? Oh boy, just by writing the question I think I may have figured it out, I'll post it anyways because (1) I could be wrong and (2) It could help someone else. It just hit me but the directive that is forcing www to -www specifies what type of redirect to do here [R=301,L]. So to try to answer my own question before even posting it this could probably do the trick: _RewriteCond %{SERVER_PORT} 80 _ _RewriteRule ^(.*)$ https://example.com/$1 [_R=301,R,L] I'll be testing it out ASAP and again I'll post the question anyways just in case it doesn't work, in case someone has a good suggestion or to help someone that could be in the same situation. If this is turns out right I will need someone to slap me in the face 😐
Intermediate & Advanced SEO | | stevenpicado0