Trailing slash before a query string. Bad practice

2019-01-25 08:40发布

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?

1条回答
一夜七次
2楼-- · 2019-01-25 09:35

It’s valid:

  1. The path component may end with a slash (/).
  2. The query component starts with the first question mark (?) in the URI.
查看更多
登录 后发表回答