.htaccess-ErrorDocument和mod_rewrite冲突

时间:2019-01-27 00:02:35

标签: .htaccess redirect seo http-status-code-404

自定义404页面不起作用,请找出错误。 似乎ErrorDocument和mod_rewrite模块之间存在冲突。

RewriteCond %{HTTP:X-FORWARDED-PROTO} ^https$
RewriteRule .? - [E=HTTPS:on]

ErrorDocument 404 /404.html

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews -Indexes
</IfModule>

RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTPS:Authorization} .
RewriteRule .* - [E=HTTPS_AUTHORIZATION:%{HTTPS:Authorization}]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [L]

0 个答案:

没有答案