Magento Redirect Loop
-
On my clients site I changed the URL structure for products.
First they had a trailing slash:
I changed it to end in .html
Now rather than redirecting properly, it causes a redirect loop.
Any idea how I can fix this?
-
Thanks. I will look into this. great answer.
-
Alan is right, have a look at your htaccess file in the first instance to see if there are any added redirects that are conflicting with the magento system redirects. If not then I think you have managed to get magento confused switching between the tralling slash and the .html endings.
I agree with Alan that personally I prefer no slash and no .html. It might be worth taking both off and seeing if the system starts redirecting as you expect (on a test server!). If not then you might want to look at emptying your url redirect table in the db and then doing a manual url index update again (again, on a test environment). It seems that the root of your problem is a redirect loop on the trailing slash version of the url (it redirects to itself in other words) and the non trailing slash also redirects to this page. I suspect this is in the magento url db and not through htaccess, but you need to confirm that before messing with the db needlessly.
-
where have you set this redirect, via magneto? or in the .htaccess file?
I would look in my htaccess file and see what redirects are there
-
It would not mater what it sees it as, its what renders that is important. but web servers can tell what is a directory and what is not, I assume search engines can too.
-
I thought that the trailing slash for a product page gets seen as a directory. It's not, it's just a page.
What are your throughts on that?
-
Hi. Yes I've done this, on my magento and browser, but had no luck fixing.
-
Hi Ryan,
Have you manually forced a refresh of the catalog url rewrites index and cleared all you caches? Basic I know, but sometimes gets overlooked.
-
I would need to look at your code.
but why redirect to .html, it does nothing for you, and does not read as well.
my preferred url is with the slash at the end and no extension, I don't like the slash because people rarely write a slash when manually typing your url, causing a redirect to the slash.
to get rid of slash you need something like
RewriteRule (.)/$ $1 [L,R]
or if you must have .html
RewriteRule (.)/$ $1.html [L,R]
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
-
How to remove 302 redirects in Magento?
We're seeing a couple of temporary redirects. One for the http pointing to https. Another for /checkout pointing to/checkout/cart. We don't have an internal dev so not sure how to remove these. Would anyone know? I've set up the 301s but they're not overriding and I'm still seeing the issues in the crawl. Thanks in advance for your help!
Technical SEO | | LASClients0 -
301 Redirect Review Nodes
I have a client who rents out vacation beach rentals. They currently have thousands of homes under management. Each property has its own internal reviewing platform. Reviews are not really intended to be viewed on their own, as in a stand alone page with just the review on it. The problem is that Drupal makes just about every type of node viewable on its own dedicated URL. I was just thinking about taking request to view stand alone reviews and 301’ing them to their respective property page, the context in which they are intended to be viewed. The website has about 2500 review nodes currently crawlable via Drupal that sit on their own URLs. Would there be a material impact to 301 them to their respective property page when any attempt to view them on their own is made to the site?
Technical SEO | | conversionpipeline20 -
301 Redirect Question
I am working with a website and I ran a Screaming Frog and noticed there are 4,600 301's on the website (www.srishoes.com). It seems like the issue is between the www. and without it and they aren't working together. Is this something that the website provider should update and what type of impact might this have on the site? Thanks!
Technical SEO | | ReunionMarketing
Matt0 -
URL Changes And Site Map Redirects
We are working on a site redesign which will change/shorten our url structure. The primary domain will remain the same however most of the other urls on the site are getting much simpler. My question is how should this be best handled when it comes to sitemaps because there are massive amounts of URLS that will be redirected to the new shorter URL how should we best handle our sitemaps? Should a new sitemap be submitted right at launch? and the old sitemap removed later. I know that Google does not like having redirects in sitemaps. Has anyone done this on a large scale, 60k URLs or more and have any advice?
Technical SEO | | RMATVMC0 -
Redirecting 404
Hi. I'm working on a wordpress site, which got some old deleted pages indexed and now shows a 404 (also in the results) As these old pages earlier got content and probably also some links pointing towards it, what would then be best practice to do? Should i make an 301 redirect? Make the 404 noindex?
Technical SEO | | Mickelp0 -
Redirect everything from a certain url
I have a new domain (www.newdomain.com) and and an old domain (www.olddomain.com). Currently both domains are pointing (via dns nameserves) at the new site. I want to 301 everything that comes from the www.oldsite.com to www.newsite.com. I've used this htaccess code RewriteEngine On RewriteCond %{HTTP_HOST} !^www.newsite.com$
Technical SEO | | EclipseLegal
RewriteRule (.*) http://www.newsite.com/$1 [R=301,L] Which works fine and redirects if someone visits www.olddomain.com but I want it to cover everything from the old domain such as www.olddomain.com/archives/article1/ etc. So if any subpages etc are visited from the old domain its redirected to the new domain. Could someone point me in the right direction? Thanks0 -
Do search engines treat 307 redirects differently from 302 redirects?
We will need to send our users to an alternate version of our homepage for a few hours for a certain event. The SEO task at hand is to minimize the chance of the special homepage getting crawled and cached in the search engines in place of our normal homepage. (This has happened in the past so the concern is not imaginary.) Among other options, 302 and 307 redirects are being discussed. IE, redirecting www.domain.com to www.domain.com/specialpage. Having used 302s and 301s in the past, I am well aware of how search engines treat them. A 302 effectively says "Hey, Google! Please get rid of the old content on www.domain.com and replace it with the content on /specialpage!" Which is exactly what we don't want. My question is: do the search engines handle 307s any differently? I am hearing that the 307 does NOT result in the content of the second page being cached with the first URL. But I don't see that in the definition below (from w3.org). Then again, why differentiate it from the 302? 307 Temporary Redirect The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field. The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s) , since many pre-HTTP/1.1 user agents do not understand the 307 status. Therefore, the note SHOULD contain the information necessary for a user to repeat the original request on the new URI. If the 307 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
Technical SEO | | CarsProduction0 -
How to Redirect only specific pages to new domain
My HTACCESS FILE IS AS FOLLOWS: rewriteengine on
Technical SEO | | askthetrainer
rewritecond %{HTTP_HOST} ^mydomain.com$
rewriterule ^mydomain/(.*)$ "http://www.mydomain.com/$1" [R=301,L] #4d864805b49b5 I want to move ONLY specific pages from this domain to a new domain How do I edit my HTACCESS (which redirects http:// to www.) to move specific pages from old domain (which I have to delete) to new domain.... I.e. http://mydomaon.com/move.html needs to move to http://mynewdomain.com/move.html Where i can delete the original domains0