2013-06-13 4 views
0

.htaccess 및 mod_rewrite에 대한 경험이 있지만이 기능을 사용할 수 없습니다. 기본적으로 나는 "public"하위 디렉토리에있는 기존 파일을 가리키는 사람들을 제외하고 모든 URL을 index.php로 리다이렉트하지 않을 것입니다. > /public/logo.png http://example.com/logo2.png - ->의 index.php (logo2.png가 존재하지 않는.htaccess 서브 디렉토리에 RewriteRule이있는 경우

http://example.com/logo.png : 나는 /public/logo.png 같은 파일이있는 경우

예를 들어,이 원하는) http://example.com/whatever -> index.php를

이 매우 지저분한 외모에도 불구하고, 나는 마침내이 문제를 해결 아민의 도움에

답변

2

감사를 :) 감사합니다

RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule ^(.*)$ - [L] 

RewriteCond %{DOCUMENT_ROOT}/public/$1 -f 
RewriteRule ^(.*)$ /public/$1 [L] 

RewriteRule ^(.*)$ /index.php [L] 

그것이

2
RewriteEngine on 

RewriteCond %{DOCUMENT_ROOT}/public/$1 -f 
RewriteRule ^(.*)$ /public/$1 [L] 

RewriteCond %{REQUEST_URI} !^/index\.php$ 
RewriteRule ^(.*)$ /index.php [R=301,L] 
+0

희망이 도움 :( –

+0

지금은 작업 조건을 잊었 "이 웹 페이지에 리디렉션 순환 오류가 있습니다" –

관련 문제