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法语的)