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]
精彩评论