회사 웹 사이트에 몇 가지 문제가 있습니다. 모든 것은, 일주일 전에 우리의 내 사이트를 확인하지만에 대해 작업 한아파치 404 URL이 작동하지 않습니다.
: 같은
이# Virtual site directory
#
# This script lets us make use of default
# versions of files used in a typical site.
# When a request on the site is made for a file
# that doesn't exist, instead of a 404 we rewrite
# the path to /_control/site/
#
# Any file in the directory this script is in will
# take precedence over this script, so this script
# only comes into play if the file does not exist.
# First, set up URL rewriting
Options +FollowSymLinks
RewriteEngine On
# Add trailing slash for directories
# TODO: fix if site not in root dir (e.g. DEV server)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !.+\.(php|js|css|gif|jpg|jpeg|png)$ [NC]
RewriteCond %{REQUEST_URI} !.*/$
RewriteRule ^(.*)$ /$1/ [L,R=301]
# This Apache mod_rewrite rule checks to see
# if the requested file exists, if it doesn't
# then we rewrite to the respective site location.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^.*/_control/(admin|common).*$
RewriteCond %{REQUEST_FILENAME} !^.*/_control/site/.*$
RewriteRule ^(.*)$ site/$1 [L]
내 응용 프로그램의 구조는 같습니다 내 동료는이 같은 _control
디렉토리 안에 .htaccess
파일을 떠났다. com/admin 및 404 페이지가 호스팅 회사의 웹 사이트로 리디렉션되기 시작했습니다. DaveG는 이미 문제의 첫 번째 부분 인 https://stackoverflow.com/a/26013322/1933380에 응답했으며 가상 디렉터리를 작동시킬 수있었습니다. 나는 아직도 404 페이지에 문제가있다. 나는 뭔가를 놓치고 있거나 실수를하고 있는가?
.htaccess에 'ErrorDocument 404' 행이 표시되지 않습니다. 또한 존재하지 않는 파일이나 디렉토리가'site/$ 1'로 보내면 404 처리에 영향을 미칠 것입니다. – anubhava