2014-11-30 5 views
1

htaccess 파일에 어떤 문제가 있습니까? 다음과 같이 내 사이트에 액세스 할 수 있습니다. site.com, site.com/en, site.com/en/dir, site.com/en/dir/subdir. 그러나 나는 (site.com/en 또는 site.com/en/dir 같은 URL은,을 index.php 만 site.com 포인트 반환 404 오류. mod_rewrite를가에) 404 오류 를 얻을 수htaccess 3 레벨 디렉토리 다시 쓰기 규칙

RewriteEngine on 
Options -Indexes 
Options +FollowSymlinks 

AddDefaultCharset utf-8 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-l 
RewriteRule ^([a-zA-Z0-9_]+)(/?)$ index.php?route=$1 [QSA,L] 
RewriteRule ^([a-zA-Z0-9_]+)(/?)([a-zA-Z0-9_\-]+)(/?)$ index.php?route=$1&subroute=$3 [QSA,L] 
RewriteRule ^([a-z]+)(/?)([a-zA-Z0-9_]+)(/?)([a-zA-Z0-9_\-]+)(/?)$ index.php?language=$1&route=$3&subroute=$5 [QSA,L] 

답변

1

것이 있는지 확인합니다. htaccess 및 mod_rewrite가 사용 가능합니다. 그들은이 활성화 된 후에는 사용할 수 있습니다

AddDefaultCharset utf-8 
Options +FollowSymlinks -Indexes 
RewriteEngine on 
RewriteBase/

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d [OR] 
RewriteCond %{REQUEST_FILENAME} -l 
RewriteRule^- [L] 

RewriteRule ^(\w+)/?$ index.php?route=$1 [QSA,L] 
RewriteRule ^(\w+)(/?)([\w-]+)/?$ index.php?route=$1&subroute=$2 [QSA,L] 
RewriteRule ^([a-z]+)/(\w+)/([\w-]+)/?$ index.php?language=$1&route=$2&subroute=$3 [QSA,L] 
+0

문제를 발견하는 데 도움이 , [이 답안의 왼쪽 상단에 ** 체크 표시 **를 클릭하여 대답을 표시 할 수 있습니다] (http://meta.stackexchange.com/a/5235/160242) – anubhava

0

이유는 DOM 인코딩없이 UTF8에서 .. 줄 바꿈을 제거 메모장 6.5.5에 있던이 밖으로 일 경우 온라인 htaccess로 테스터

관련 문제