Redirect with only case changing causing ERR_TOO_MANY_REDIRECTS #29125
-
I have a page The following settings cause an infinite redirect loop no matter which version is navigated to.
The following works in most cases, but causes a 404 if navigating to
Is there a way to set this up so it works in all cases? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Oh. Interesting. So apparently it works fine in all cases once deployed to production. But when testing locally, it would return a 404. |
Beta Was this translation helpful? Give feedback.
-
Wooow @thepuzzlemaster, we have a big problem here... First of all, I will give you a piece of important advice, don't use camel case in your routes, don't use upper case, use only lower case in URLs... I say that because the behavior in most cases is unpredictable, for example, after you access the route "domain/Home" and it runs, if you access "domain/home" the chrome browser will replace the URL with "domain/Home" (the first one), windows servers such as IIS works ignoring case in URL, Linux servers will consider the case of URL... Then, just work with snake case in your URLs, this will avoid a lot of headaches and problems for you. After this advice, lets to a possible solution: As you can notice, redirects are case insensitive while your pages are case sensitive, then, the simples way is o configure a redirect like this: {
source: '/searchlistings',
destination: '/search-listings'
} And then rename your page to "search-listings.jsx" (.jsx, or .js, or .tsx, depends on your project) I hope it helps you. |
Beta Was this translation helpful? Give feedback.
Wooow @thepuzzlemaster, we have a big problem here...
First of all, I will give you a piece of important advice, don't use camel case in your routes, don't use upper case, use only lower case in URLs... I say that because the behavior in most cases is unpredictable, for example, after you access the route "domain/Home" and it runs, if you access "domain/home" the chrome browser will replace the URL with "domain/Home" (the first one), windows servers such as IIS works ignoring case in URL, Linux servers will consider the case of URL... Then, just work with snake case in your URLs, this will avoid a lot of headaches and problems for you.
After this advice, lets to a possible solution:
As yo…