Multiple Redirects

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I'm seeing some URLs on our site are generating two directions. One of the redirects is caused by nop not bothering to include the language in the redirected URL.

Somehow I got a Category called "corkscrews" (Standard), "cutlery-accessories" (English) and some french string for French. A incoming URL of /en/corkscrews will get redirected (302) to /cutlery-accessories. Since that doesn't have the language on it, nop will then redirect to /en/cutlery-accessories (a 301 this time).

Redirecting a single url twice is bad. It would appear that the issue is that the first time it redirects, it should include the language in the redirected url.
6 years ago
demckee wrote:
I'm seeing some URLs on our site are generating two directions. One of the redirects is caused by nop not bothering to include the language in the redirected URL.

Somehow I got a Category called "corkscrews" (Standard), "cutlery-accessories" (English) and some french string for French. A incoming URL of /en/corkscrews will get redirected (302) to /cutlery-accessories. Since that doesn't have the language on it, nop will then redirect to /en/cutlery-accessories (a 301 this time).

Redirecting a single url twice is bad. It would appear that the issue is that the first time it redirects, it should include the language in the redirected url.


Exactly redirecting it for two times is an issue. Did you checked you have configured it correctly and you don't have any other redirection manually configured?
6 years ago
There are no other redirects running, and everything is setup properly.

If you look at the code in Nop.Web.Framework.Seo.GenericPathRoute, you'll see where the 301 and 302 redirects are being generated. When it forms the redirected url, it doesn't include the language code. That is what's causing the second redirect.
5 years ago
Have you got any solution, we have similar problem and language redirect 302 which should be 301 for the default language.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.