2012-01-02 2 views
1

국가라는 웹 루트에 폴더가 있습니다. 이 하위 폴더에 index.html 페이지가 있습니다. domain.com/country를 입력하면 domain.com/app/webroot/country/가 표시됩니다. 국가 뒤에 '/'를 입력하면 필요한 domain.com/country/가 표시됩니다. htaccess를 domain.com/country에서 domain.com/country/로 리디렉션하려면 어떻게해야합니까?htaccess 하위 페이지의 색인 페이지에서 하위 폴더로 리디렉션합니다.

규칙을 국가 폴더에만 사용하고 싶습니다. 나는 다음과 같은 규칙을 가지고 있지만, 나는 원하지 않는 전체 사이트에 적용된다.

RewriteEngine on 
# index.php to/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/ 
RewriteRule ^(.*)index\.php$ /$1 [R=301,L] 

도움이 되겠습니다.

답변

0

시도 부가 앞서 다른 규칙의 당신이 가지고있는 도메인의 루트 폴더에 htaccess로 파일에 다음

RewriteEngine on 
RewriteBase/

#if country does not have a trailing slash 
RewriteCond %{REQUEST_URI} ^/country$ [NC] 
#redirect to country with a trailing slash 
RewriteRule . /country/ [L,R=301] 
관련 문제