저는 리눅스 나 PHP 개발이 아니지만 .htaccess와 관련된 물건을 다루는 초보자입니다. 미친 운전에 오류가 있습니다.public_html의 .htaccess가 404 페이지를 반환합니다.
다시 쓰기 및 userdir 모듈을 모두 사용하는 아파치가 있습니다. 내가
Options +FollowSymLinks
RewriteEngine On
#RewriteRule ^images/ - [L]
#RewriteRule ^css/ - [L]
#RewriteRule ^js/ - [L]
RewriteRule ^favicon.ico - [L]
RewriteRule ^(images|css|js|classes)($|/) - [L]
RewriteRule ^PayPal classes/paypal/initPP.php [L,QSA]
RewriteRule ^PDF MakePDF.php [L,QSA]
RewriteRule ^([-_0-9a-zA-Z:/]*)$ index.php?PageCall=$1 [L,QSA]
# 400 - Bad request
ErrorDocument 400 /index.php?error=400
# 401 - Authorization Required
ErrorDocument 401 /index.php?error=401
# 403 - Forbidden
ErrorDocument 403 /index.php?error=403
# 404 - Wrong page
ErrorDocument 404 /index.php?error=404
# 500 - Internal Server Error
ErrorDocument 500 /index.php?error=500
내 문제 코드가있는 htaccess로이 곳 내 mod_userdir.conf은 내가 $ HOME/public_html을/mywebsite에서 웹 페이지를 구축하고이
<IfModule mod_userdir.c>
UserDir disabled root
<Directory /home/*/public_html>
AllowOverride All
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Require all granted
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Require all denied
</LimitExcept>
</Directory>
</IfModule>
처럼 보이는 http://localhost/~user/mywebsite 할 때마다 accesss 404 페이지를 반환합니다. 나는 짐작하는 재 작성 문제를 코멘트
RewriteRule ^([-_0-9a-zA-Z:/]*)$ index.php?PageCall=$1 [L,QSA]
페이지는 $ _GET 변수에 관련된 PHP는 오류가 표시 될 때, 때문이다.
내가 뭘 잘못하고 있니?.
미리 감사드립니다.
편집 : 나는 스스로에게 대답한다. AllowOverride On은 httpd.conf에도 써야합니다. 그래서 찾았습니다
# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride None
Require all denied
</Directory>
그리고 AllowOverride를 "All"로 변경했습니다. 귀하의 하위 디렉토리에서 작업으로
'$ HOME/public_html/mywebsite'는'/ ~ user/mywebsite'와 동일합니까? – anubhava
예. 내 홈페이지에 대한 절대 경로는/home/user/public_html/mywebsite이고 .htaccess가없는 다른 웹 페이지는 http : // localhost/dhouard/someothepage에 연결됩니다. – Dhouard