Redirect: False Not Affecting Behavior
See original GitHub issueI started using express as part of Angular Universal and started facing this issue: https://github.com/angular/universal/issues/2827
- Request with no trailing slash (/welcome)
- A 301 redirect returned to request with location including the trailing slash (/welcome/)
- 200 OK returned
- Trailing slash stripped in the URL bar in browser
I see other people have brought it up and the answer is usually try redirect: false
so that server-static
doesn’t add the trailing slash.
Problem is I tried using that using Angular Universal 10.1.1 and Express 4.15.2 and it had no effect.
Does Express / Node have any sort of caching that would cause this change to not show and if so anyone know how to prevent that? Is it working for everyone else still?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
No session after signin with redirect: false · Issue #1264 - GitHub
Hi there! The point of adding redirect: false is exactly stopping the page from redirecting to anywhere. Since it is the redirect that...
Read more >event.preventDefault() vs. return false - Stack Overflow
return false from within a jQuery event handler is effectively the same as calling both e.preventDefault and e.stopPropagation on the passed jQuery.
Read more >Redirections in HTTP - MDN Web Docs - Mozilla
Redirection loops happen when additional redirections follow the one that has already been followed. In other words, there is a loop that will ......
Read more >Changed behavior in redirects - Netlify Support Forums
Hi all, We're working on making a breaking change in how our redirects feature works regarding file shadowing. We want to explain to...
Read more >Redirect Loops: Why they harm your SEO performance
Redirect loops often occur as a result of a poor redirect configuration. This can be caused by incorrect redirect rules in your web...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @ewwwgiddings sorry for your issue. It is certainly possible that something else outside of
serve-static
is performing the redirect, which is whyredirect: false
there is having no effect; that answer would only apply if that is were your redirect is coming from. Express.js itself has no caching internally. We can help, but there are too many unknowns and we would need your complete application and reproduction steps in order to debug through it to determine where the redirect originates.We can close this. I’m working on another way around this and I’m no longer thinking it’s certain to be related to this. Thank you a ton for your help!