开发者

Remove trailing slash if index.php is being used

开发者 https://www.devze.com 2023-04-12 15:21 出处:网络
I am working on a new service which is powered by a backend API, the location of the API is as follows...

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://st开发者_JAVA百科ackoverflow.com/users/955822/nblackburn?tab=reputation

Kind Regards,

Nathaniel Blackburn


Rewrite Rule (.*?)/\?(.*) $1?$2 [NC,P,L]

Does something like this work?

http://httpd.apache.org/docs/current/mod/mod_rewrite.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号