2
启用DirectorySlash如果我在网站的根在我的.htaccess验证码:而不显示查询
RewriteCond %{REQUEST_URI} ^/foo/bar/
RewriteRule ^foo/bar(.*)$ http://example.org/foo/?file=$1 [P,QSA]
而且有这样的文件结构:
foo
+-- index.php
+-- bar
+-- qaz
+-- file.txt
我请求的页面http://example.org/foo/bar/qaz/
它将在服务器上重定向到http://example.org/foo/?file=/qaz/
。 但是,如果我请求页面http://example.org/foo/bar/qaz
它将重定向到http://example.org/foo/?file=/qaz
,但它会在浏览器中显示http://example.org/foo/bar/qaz/?file=/qaz
。
如何启用DirectorySlash,但仍隐藏用户的查询?