我想爲我的小型web服務器創建一個自定義錯誤頁面,該頁面在raspbian上的apache2上運行。但遺憾的是,創建的頁面在瀏覽器無法解析的情況下不會被瀏覽器加載......瀏覽器只是在左上角打印創建的錯誤頁面的路徑。Apache2自定義404頁面將不會加載(.htaccess)
HTML自定義頁面至今:
<!DOCTYPE html><html><head></head><body><p>Nooooot found ...</p></body></html>
加載頁面的HTML:
<html><head></head><body>sites/errorsites/404.html</bod></html>
我的.htaccess文件,這是擺在/ var/WWW/
Options -Indexes
ErrorDocument 404 sites/errorsites/404.html
我的errorsites-dir的位置與自定義錯誤:/ var/www/sites/
(當然我在/ etc/apache2的/網站,提供給 「所有」 的默認文件中設置有 「AllowOverride」。)
感謝您的幫助
盧卡斯
編輯:
的ServerAdmin網站管理員@本地
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
:阿帕奇的 默認文件
謝謝! :-) Awwwh這樣一個愚蠢的錯誤... –