Trailing slash before a query string. Bad practice?

六眼飞鱼酱① 提交于 2019-11-27 23:39:46

问题


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:


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.


来源:https://stackoverflow.com/questions/29855027/trailing-slash-before-a-query-string-bad-practice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!