如果正在使用index.php,则删除尾部斜杠
我正在开发一项由后端 API 提供支持的新服务,API 的位置如下......
api.nblackburn.me/jobtrackr/
但是如何而不是拥有这个......
api.nblackburn.me/jobtrackr/?action=signin
我可以将其更改为这个...
api.nblackburn.me/jobtrackr?action=signin
而不再次添加。我在几个网站上看到过这样做,并且想知道它是如何完成的,因为尾部斜杠看起来非常不舒服。我知道这只是表面上的改变,但任何帮助都会很棒,再次感谢。
甚至堆栈溢出也在使用这种方法,例如......
https://stackoverflow.com/users/955822/nblackburn?tab=reputation
亲切的问候,
纳撒尼尔·布莱克本
I am working on a new service which is powered by a backend API, the location of the API is as follows...
api.nblackburn.me/jobtrackr/
but how instead of having this...
api.nblackburn.me/jobtrackr/?action=signin
could i change it to this...
api.nblackburn.me/jobtrackr?action=signin
without it being added again. I have seen this being done on several websites and was wondering how its done as the trailing slash is very unpleasant to look at there. I know its only a cosmetic change but any help would be great, thanks again.
Even stack overflow is using this method, for example...
https://stackoverflow.com/users/955822/nblackburn?tab=reputation
Kind Regards,
Nathaniel Blackburn
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这样的东西有用吗?
http://httpd.apache.org/docs/current/mod/mod_rewrite.html
Does something like this work?
http://httpd.apache.org/docs/current/mod/mod_rewrite.html