KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The short question is - what is the best practice - to use or not to use a trailing slash in URLs. There are many articles: this , this , this . However, they all seem to deal with static directory structure. What about dynamic urls, like those rewritten, or those handled by a central facility (like a web framework, for example), that forward to internal resources depending on convention/configuration. For them it is no longer the case that the web server actually searches and figures out exact locations - it is just a matter of parsing. So, for example with spring mvc you declare that a given class method is invoked when the URI matches /service/action/{pathParam} - for this URL, imo, it does not make sense to have a trailing slash - the request is handled by one and the same servlet each time, which does the parsing. What I think is that one should just be consistent - either use trailing slashes everywhere, or don't use them at all. So: what's the best practice - with, without, or whatever-just be consistent what's the reason to choose one over the other
Tags (comma-separated)
Save Edits
Cancel