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
-
Bulk redirection of blogs
Hi all, we're going to changing the url structure of our website. Moving from: /news-and-views/blog/thisistheblogpost to /blog/thisistheblogpost (ie removing the /news-and-views/ portion of the url). There's approximately 300 posts. I have 2 questions - will this have an impact on domain wide authority? and is bulk 301 redirects the best solution? The blogs themselves don't get a huge amount of traffic but we just want to make sure we don't do something that will be penalized by search engines.
Technical SEO | | francisclark2 -
301 redirect syntax for htaccess
I'm working on some htaccess redirects for a few stray pages and have come across a few different varieties of 301s that are confusing me a bit....Most sources suggest: Redirect 301 /pageA.html http://www.site.com/pageB.html or using some combination of: RewriteRule + RewriteCond + RegEx I've also found examples of: RedirectPermanent /pageA.html http://www.site.com/pageB.html I'm confused because our current htaccess file has quite a few (working) redirects that look like this: Redirect permanent /pageA.html http://www.site.com/pageB.html This syntax seems to work, but I'm yet to find another Redirect permanent in the wild, only examples of Redirect 301 or RedirectPermanent Is there any difference between these? Would I benefit at all from replacing Redirect permanent with Redirect 301?
Technical SEO | | SamKlep1 -
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 -
Geographical targeting with Magento
We have a Magento store, with multiple stores/domains setup. There is only really one reason that we have the multiple domains; we use an automatic GEOIP store switcher to send a customer to the right store, so that they pay the proper shipping, see the proper pricing etc, and a couple small differences in the design templates. But all the content is identical. So we have: domain.com (main website)
Technical SEO | | maartenvr
domain.ca (where most other countries are directed to based on GEOIP)
domain.eu Since the content is the same, what is the best strategy here? I looked at several options: 1. Custom canonical urls, making each page on the .ca and .eu use canonical url of the .com
2. Completely block the .ca and .eu from robots.
3. Leave it the way it is0 -
SEO Redirect
If we have several hundred domain names currently using a park page, would we be better served having them redirect to our corporate homepage for SEO purposes?
Technical SEO | | mkessler0 -
301 redirect of a subdirectory
Hello! I am working on a website with the following structure: example.com/sub1/sub2/sub3. The page "example.com/sub1" does not exist (I know this is not the optimal architecture to have this be a nonexistent page). But someone might type that address, so I would like it to redirect it to example.com/sub1/sub2/sub3. I tried the following redirect: redirect 301 /sub1 http://example.com/sub1/sub2/sub3. But with this redirect in place, if I go to example.com/sub1, I get redirected to example.com/sub1/sub2/sub3/sub2/sub3 (the redirect just inserts extra subdirectories). If someone types "example.com/sub1" into a browser, I would "example.com/sub1/sub2/sub3" to come up. Is this possible? Thank you!
Technical SEO | | nyc-seo0 -
301 redirects
Hi, I am a working on a new web site, and I want to redirect all the urls of another site (on a different host) to this one. According to both hosts it is "impossible" to do this for all urls. I don't believe that to be the case, but how do I do this? And, should both sites be hosted on the same server first?
Technical SEO | | vibelingo0 -
Need Help with MAGENTO - URL rewrite
Hello... Hopefully a Magento expert will stumble across this question and help me out. I have noticed that my site is no longer as prominent as it once was for specific product pages... I am looking for help in rewriting the URL's for the product pages. I want it to have xyz.com/product (which exists if you hard code it into the site) If you wind up on the product by clicking throught the categories the url looks like: xyz.com/category/subcategory/product. Does anyone know how to make it so when you land on a product page it is just xyz.com/product ? My Site is : http://goo.gl/JgK1e Thanks for the help...
Technical SEO | | Prime850