如果它是第二个目录mod_rewrite,则忽略最后一个目录

时间:2010-12-15 18:58:17

标签: .htaccess mod-rewrite

我正在尝试设置一个将执行以下操作的mod_rewrite

www.mysite.com/dir/ignoreMe
will map to
www.mysite.com/dir
however in the browser the url will still appear to be
www.mysite.com/dir/ignoreMe

if the url entered is simply
www.mysite.com/dir
the rewrite shouldn't do anything.

这样我可以使用last / second目录,就好像它是一个GET查询字符串

1 个答案:

答案 0 :(得分:0)

RewriteRule ^([^/]*)/([^/]+)$ /$1