Trailing slashes
Url尾部的/
视情况可能会有不同预期:
| 位置 | 例子 | 是否相同 |
| ——- | —————————————— | ————- |
| domain后 | github.com/github.com | 相同 |
| path后 | github.com/kivihubgithub.com/kivihub/ | 不同,但可以通过重定向趋同 |
URL规范里path后的有/
,资源视为一个目录,否则视为一个文件,当然你也可以按个人喜好定义。
参考
- Should You Have a Trailing Slash at the End of URLs?
- https://developers.google.com/search/blog/2010/04/to-slash-or-not-to-slash