开发者

Remove trailing slash if index.php is being used

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜