파일 확장자를 제거하는 URL 재 작성이 있습니다. .html
페이지에서 작동하지만 .php
개의 파일에 "404 페이지를 찾을 수 없음"오류가 표시됩니다. 여기URL 재 작성은 .html이지만 .php에는 작동하지 않습니다.
내 전체 .htaccess
파일 내가 잘못하고있는 무슨
# The following will allow you to use URLs such as the following:
#
# example.com/anything
# example.com/anything/
#
# Which will actually serve files such as the following:
#
# example.com/anything.html
# example.com/anything.php
#
# But *only if they exist*, otherwise it will report the usual 404 error.
Options +FollowSymLinks
RewriteEngine On
rewritecond %{HTTP_HOST} ^inaflashgraphics.com$
rewriterule^"http\:\/\/www\.inaflashgraphics\.com\/" [R=301,L] #4e2f2fa615667
# Remove trailing slashes.
# e.g. example.com/foo/ will redirect to example.com/foo
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [R=permanent,QSA]
# Redirect to HTML if it exists.
# e.g. example.com/foo will display the contents of example.com/foo.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]
# Redirect to PHP if it exists.
# e.g. example.com/foo will display the contents of example.com/foo.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]
입니까?
RewriteLog를 추가하고 RewriteLogLevel을 5로 설정하여 단계별로 볼 수 있도록하는 것이 좋습니다. – GarethL
확실하지 않은 방법 – jardane
"RewriteEngine On"다음에 "RewriteLog/path/to/your/new/log"및 "RewriteLogLevel 5"행을 별도의 행에 추가하십시오. 이렇게하면 지정한 경로에 로그 파일이 만들어지고 올바른 파일을 결정할 때 다시 쓰기 엔진이 만드는 모든 단일 단계가 기록됩니다. 분명히 문제를 해결했을 때 이것을 제거하는 것을 기억하십시오! – GarethL