1
我环顾四周寻找答案,但我找不到适合我的东西。删除尾部的斜线
我有这样的:
RewriteRule ^(.*)/?$ example.php?option=$1 [L]
我想是这样的:
http://example.com/foo/bar/ > http://example.com/example.php?option=foo/bar
http://example.com/foo/bar > http://example.com/example.php?option=foo/bar
但正在发生的事情是这样的:
http://example.com/foo/bar/ > http://example.com/example.php?option=foo/bar/
http://example.com/foo/bar > http://example.com/example.php?option=foo/bar
所以,当有一个结尾斜杠,它将它添加到它发送给PHP文件的选项中,但我不希望它将其删除。有任何想法吗?
[This answer](http://stackoverflow.com/a/8744956/3770448)可能是有趣的。 – ljacqu
@ljacqu没有。由于我的网站的性质,我不能做重定向或它会循环。但我确实找到了一种在PHP文件中工作的方法。 –