这是我所拥有的.htaccess在这个级别上正常工作 mysite / new /
RewriteEngine On
RewriteBase /new/
RewriteCond %{THE_REQUEST} \s/+(new)/(?:index)?(.*?)\.html[\s?] [NC]
RewriteRule ^ /%1/%2 [R=301,L,NE]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+?)/?$ $1.html [L]
一旦我进入新的水平 mysite / new / new-level ,我会得到404.任何帮助?感谢。
答案 0 :(得分:0)
请参阅此链接
https://stackoverflow.com/questions/2828030/redirecting-to-frontpage-after-404-error-in-php
http://www.htaccessbasics.com/404-custom-error-page/
http://www.internetearnings.com/how-to-redirect-404-not-found-page-using-htaccess/