0
我想顯示我的404自定義頁面而不重定向到它(以便用戶可以看到他在導航器的欄中寫的內容而不是看到https://abadroch.fr/docs/404/)。我期試驗研究帶我到涉及PHP的問題,但我只是用集中式錯誤pages.conf(是錯了嗎?),這是非常類似的.htaccess顯示404自定義頁面而不重定向到它
# Customizable error responses come in three flavors:
# 1) plain text
# 2) local redirects
# 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#
ErrorDocument 404 https://abadroch.fr/docs/404/index.html
(我使用的URL,因爲路徑沒有工作)
However I've tested a thing concerning php (doesn't work of course)
# Customizable error responses come in three flavors:
# 1) plain text
# 2) local redirects
# 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /var/wwww/docs/404/index.html [L]
(編輯之前,已經有一些的RewriteCond /重寫規則,所以沒有必要把一個RewriteEngine敘述上)
感謝您的幫助! (對不起,我的英語不好,我是16yo法語的)