-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trailing slash breaks url #323
Comments
Thanks. Totally should work. Since URL stuff is mostly happening at client side (not at Express), I don't think we can easily create 301 redirects for these. We're using Angular ui-router. Here's the config for And here seems to be the solution: angular-ui/ui-router#50 (towards the end of the thread) |
That last link with solution has reference to this: https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-make-a-trailing-slash-optional-for-all-routes
Don't have any experience with MEAN or Angular. I wonder whether there is any place where angular.js can be configured globally (maybe here?) to something like this: angular.config(function ($urlMatcherFactoryProvider) {
$urlMatcherFactoryProvider.strictMode(false);
}); Otherwise it would have to be configured in the individual modules (which is not very DRY). |
Cool. I'll test that out at some point. That would go here https://github.com/Trustroots/trustroots/blob/master/modules/core/client/app/init.js#L15 |
Finally works, e.g.: https://www.trustroots.org/statistics/ |
https://trustroots.org/profile/:someusername is ok, but
https://trustroots.org/profile/:someusername/ leads to 404 not exist.
the same with /search vs. /search/ and other urls.
Maybe it's by design, but it is confusing, i.e. when one writes a link from one's (human) memory and adds the slash accidentally (happened already).
I'm not sure about best practices/standards for this, but enabling it or (permanent?) redirect would be cool.
fast research:
possible fix: http://stackoverflow.com/questions/13442377/redirect-all-trailing-slashes-gloablly-in-express
some fun with redirecting and trailing slashes: http://expressjs.com/en/api.html#res.redirect
and some article etc.
The text was updated successfully, but these errors were encountered: