2011-11-11 4 views
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는 어떻게 사용할 수 있습니까?

답변

0

DirectorySlash는 '/ foo/bar/qaz'디렉토리가있는 경우에만이 작업을 수행합니다.

DirectorySlash는 rewriteBase를 준수하지 않습니다. 이 기능을 사용 중지하고 직접 할 수도 있습니다.

RewriteCond %{DOCUMENT_ROOT}/$1 -d 
RewriteRule ^(.*[^/])$ $1/ [R,L] 
관련 문제