开发者

Get last element between slashes with .htaccess

As开发者_如何学运维suming a string like http://domain.com/aaaa/bbb/ccc/ddd/

I want to use a .htaccess file to get the last element between slashes, in this case ddd.

I am using:

RewriteRule (.*)/$ ?pt=$1 [L] 

But it is not working.


Try this regex:

([^/]+)/$ ?pt=$1 [L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜