1

每当我键入包含目录索引的编造地址时,它都会将其删除。问题是地址包含禁止的子目录时。它会自我减少,直到它被禁止。如何让它重定向到主页而不是减少自己?

Options -Indexes +FollowSymlinks -MultiViews

RewriteEngine on

DirectoryIndex index.htm index.html index.php

# REDIRECT www to non-wwww
# Set Canonical URL
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# REMOVE Directory Index From URL
RewriteRule ^([a-zA-Z0-9_-]+/)?index\.(htm?|html?)$ /$1 [R=301,L]

# Custom Error Documents
ErrorDocument 404 /errors/404_notfound.htm
4

0 回答 0