2015-01-28 2 views
0

요청 uri가 "de"인 경우 "index_de.html"로 리다이렉션을 원한다. 그렇지 않으면 모든 사람이 index.html로 리디렉션되어야한다. 코드가 작동하지 않는 이유는 무엇입니까?htaccess, request uri will redirect

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^.*$ /index.html [L] 

RewriteCond %{REQUEST_URI} ^/de 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^.*$ /index_de.html [L] 

답변

0

당신은 사용할 수 있습니다

RewriteEngine on 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^de/.*$ /index_de.html [L] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule^/index.html [L] 

일반적인 포괄 유형 전에보다 구체적인 규칙을 유지합니다.