모든 URL 또는 파일을 index.php로 리디렉션하지만 일부 예외 (아래 참조)를 원합니다. 그것은 내 로컬 서버에서 정상적으로 작동하지만 실제 서버에서는 정상적으로 작동하지 않습니다.htaccess index.php로 리디렉션하여 다른 모든 PHP 파일을 무시합니다.
제 문제는 collection.php와 같은 파일이 브라우저 URL에 입력하고 htacess에서 무시할 때 열리는 것입니다. 이러한 파일은 내 index.php로 리다이렉트되기도합니다. 내가 무엇을 할 수 있을지?
내 htaccess로 :
# html5 pushstate (history) support:
AddHandler php5-cgi .php
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /WALT/
#rewriteRule ^(([a-z0-9\-]+/)*[a-z0-9\-]+)$ $1/ [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteCond %{REQUEST_URI} !/content/create/ [NC]
RewriteCond %{REQUEST_URI} !/img/ [NC]
RewriteCond %{REQUEST_URI} !/video/ [NC]
RewriteCond %{REQUEST_URI} !/favicon.ico [NC]
RewriteCond %{REQUEST_URI} !/cms/ [NC]
RewriteCond %{REQUEST_URI} !^/collection.php [NC]
RewriteRule (.*) index.php [L]
</ifModule>
이 파일은'DOCUMENT_ROOT/WALT' 디렉토리에 사용됩니까? – anubhava
@anubhava 예 참으로 – user2525589
그리고 예상대로 작동하지 않는 URL은 무엇입니까? – anubhava