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
-
cross canonicalization with redirect
I'm working with a website that has turned one of its pages into its own website within the main website - mostly for the ease of customers, making it simpler to access that page using www.page.com rather than www.mainsite.com/about/page.
Technical SEO | | Shrine.SEO.Gal
As a result, there are two urls for that page (the ones just mentioned), both pointing to the exact same page, but with different urls. Now, they have made it so www.mainsite.com/about/page permanently redirects to www.page.com. which I thought was a good call. However, what do I do about canonicalization? Is it good to point the canonicalization of www.page.com to www.mainsite.com/about/page so that the rankings and link equity are maintained in the main website? Or would the fact that the www.mainsite.com/about/page redirects to www.page.com mess that up? I hope this makes sense!0 -
Redirection chain and Javascript Redirect
Hi, A redirection chain is usually defined as a page redirecting to another page which itself is another redirection. URL1 ---(301/302)---> URL2 ---(301/302)---> URL3 But what about Javascript redirect? They seem to be a different beast: URL1 ---(301/302)---> URL2 ---(200 then Javascript redirect)---> URL3 From what I know if the javascript redirect is instant Google counts it as a 301 permanent redirection, but I'm still not sure about if this counts as a redirection chain. Most of the tools (such as moz) only see the first redirection. So is that scenario a redirection chain or no?
Technical SEO | | LouisPortier0 -
301 Redirecting http to https
In the Moz Site Crawl issue, I was seeing an error that said we were temporarily redirecting our homepage to https URLs. So I changed the code in htaccess to make it 301 redirect but I'm still getting the same error. I implemented it last week and we just had a new crawl yesterday. Here is the new code: RewriteEngine on
Technical SEO | | Heydarian
RewriteCond %{HTTP_HOST} ^heritagelawmarketing.com [NC]
RewriteRule ^(.*)$ http://www.heritagelawmarketing.com/$1 [L,R=301,NC] Does anyone know why I'm still getting 302 redirects? Thanks0 -
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 -
301 redirect relative or absolute path?
Hello everyone, Recently we've changed the URL structure on our website, and of course we had to 301 redirect the old urls to the coresponding new ones. The way the technical guys did this is: "http://www.domain.com/old-url.html" 301 redirect to "/new-url.html"
Technical SEO | | Silviu
meaning as a relative redirect path, not an absolute one like this:
"http://www.domain.com/old-url.html" 301 redirect to "http://www.domain.com/new-url.html" This happened for few thousands urls, and the fact is the organic traffic dropped for those pages after this change. (no other changes were made on these pages and the new urls are as seo friendly as possible, A grade on On-Page Grader). The question is: does the relative redirect negatively affects seo, or it counts the same as an absolute path redirect? Thanks,
S.0 -
Wordpress and Redirects?
I want to update my permalinks - actually I want to change the URL's to fit the content and keywords better. I can choose "edit" the URL, but don't I need a redirect? I don't see any htaccess Plugin installed.......is that what I need to be able to change my URL's in Wordpress?
Technical SEO | | cschwartzel0 -
301 redirects reverting to 302 redirects
We recently built a new website with a new site structure. To prevent there being a load of 404's I redirected the old pages to the new relevant pages with 301 redirects. A few days later the SEOmoz crawl report alerted me to a load of 302 redirects. When I looked into this for some reason all of the 301 redirects I set up are reverting to 302 redirects. I did a test by 301 redirecting a made up URL to an existing page and the same thing happens - it 302 redirects. I can't find any settings in WordPress to possibly explain why this is happening. Has anyone got any ideas why this could be?
Technical SEO | | Tone_Agency0 -
301 redirects
Hi Guys, Question,
Technical SEO | | VividLime
Lets say I have a page oldfile.php at position #2 then set-up a redirection in the following way 100 incoming external links--> oldfile.php [301 to] newfile.php Google comes along and updates its index to newfile.php and ranking of newfile.php remains at position #2. Everything is good. Lets say in 5months, I come along and delete oldfile.php so we have
100 incoming external links--> deleted(oldfile.php) or 100 incoming external links-->404 error. |||| newfile.php Do I then loose the rankings on newfile.php. My thinking is that now that all the external links now point to a page not found, newfile.php should loose rankings Am I correct in my assumption?0