I have a URL like www.example.com/store/
, which leads to a store page
When a user clicks on a discount link, it adds the parameter ?discount=foo
, so my link looks like this: www.example.com/store/?discount=foo
.
Everything is functional. But is it bad practice to have the forward slash before the query string in this situation?
It’s valid:
- The path component may end with a slash (
/
). - The query component starts with the first question mark (
?
) in the URI.
来源:https://stackoverflow.com/questions/29855027/trailing-slash-before-a-query-string-bad-practice