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
-
Redirect Chain Domain
MozPro is highlighting some redirect chain issues with our domain that I do not recall ever setting up in our redirect list. In our Moz Pro Campaign I see the Site Crawl has flagged 36 Redirect Chain Issues. I understand how the redirect chain errors can happen but I do not recall ever manually redirecting our domain, yet I have http://stickylife.com, https://stickylife.com & https://www.stickylife.com all associated in one of our redirect chain errors. When looking at our redirect files I do not see any of these domain redirects and wonder how this has happened and how to fix it. It appears as though our HTTP and HTTPS is causing some redirection. I wonder if this is coming from our DNS settings?
Technical SEO | | StickyLife0 -
Problems with canonical urls / redirect (magento webshop)
Hi all, We're running a Magento webshop and we discover some strangs things regarding canonical urls and redirects after using the Amasty improved navigation extension. To clarify, please check these four urls. They contain the same content (the same product page). https://www.afwerkingshop.be/gyproc-gipskartonplaat-ak-2600x1200x9-5mm.html https://www.afwerkingshop.be/wanden/gyproc-gipskartonplaat-ak-2600x1200x9-5mm.html https://www.afwerkingshop.be/wanden/gipsplaten/gyproc-gipskartonplaat-ak-2600x1200x9-5mm.html https://www.afwerkingshop.be/wanden/gipsplaten/standaard/gyproc-gipskartonplaat-ak-2600x1200x9-5mm.html All these four pages have different canoncials (the page url). Obviously, that's not good. However, in Google (site:...) url (1) is the only one that's indexed. Thereby, if I visit the productpage by first going to a category page (fe. www.afwerkingshop.be/wanden.html), I'm redirected to url (1), but the canonical url is www.afwerkingshop.be/last_visited_category_name/product. So, the canonical seems dynamic depending on the last visited category. And still, only url (1) is indexed. Additionally, all aforementioned pages contain . Is anyone familiar with this issue? And more important, will it cause problems in future? Thanks in advance. Kind regards, Chendon
Technical SEO | | RBijsterveld0 -
Redirects
Hello, i would like to ask which is the best redirect to use in a website now i have all my links to go to https://www.anavasis.gr Which is the best between: https://www.anavasis.gr https://anavasis.gr https://www.anavasis.gr/index.php https://anavasis.gr/index.php thanks in advance
Technical SEO | | anavasis0 -
Robots txt. in page with 301 redirect
We currently have a a series of help pages that we would like to disallow from our robots txt. The thing is that these help pages are located in our old website, which now has a 301 redirect to current site. Which is the proper way to go around? 1- Add the pages we want to disallow to the robots.txt of the new website? 2- Break the redirect momentarily and add the pages to the robots.txt of the old one? Thanks
Technical SEO | | Kilgray0 -
Temporary Redirect - on nonexistant URL
I'm getting a Temporary Redirect issue on | http://www.luckygemstones.com/botswana-legends.htm http://www.luckygemstones.com/botswana-legends.htm | http://www.luckygemstones.com/page-not-found.htm | 1 | 0 | 302 | YET! There is no such page on my site. I believe I had one once, but has been corrected for a while now. WHY is SEOMOZ picking this up as an error and how can I fix? Kathleen http://www.luckygemstones.com
Technical SEO | | spkcp1110 -
302 redirects help
Hello, I have a Magento ecommerce store and my latest seomoz crawl report shows over 10,000 302 redirects. An example is this below https://jsshirts.com.au/wishlist/index/add/product/160/ which is being redirected to http://jsshirts.com.au/enable-cookies Can anyone please help me with a solution to help with this problem. Many thanks
Technical SEO | | mullsey0 -
Temporary redirects
why is wordpress creating redirects from trackbacks and what can i do about it? according to seomoz i have several of these kinds of temporary redirects: http://redlandsorthodontics.com/about-us-2/meet-the-staff/redlands-orthodontics/trackback/ redirects to http://redlandsorthodontics.com/about-us-2 what are trackbacks anyway since i didn't purposely create them?
Technical SEO | | dad7more0 -
How do I redirect index.html to the root / ?
The site I've inherited had operated on index.html at one point, and now uses index.php for the home page, which goes to the / page. The index.html was lost in migrating server hosts. How do I redirect the index.html to the / page? I've tried different options that keep giving ending up with the same 404 error. I tried a redirect from index.html to index.php which ended in an infinite loop. Because the index.html no longer exists in the root, should I created it and then add a redirect to it? Can I avoid this by editing the .htaccess? Any help is appreciated, thanks in advance!
Technical SEO | | NetPicks0