我想使用htaccess将网站上的所有页面(包括索引)重定向到404。预先感谢。
您可以在根.htaccess文件中使用此规则:
RewriteEngine On RewriteRule ^ - [R=404,L]
以下内容适用于较新的Apache:
Redirect 404
并且您可以添加消息而无需创建如下文件:
ErrorDocument 404 "Hmm... There's nothing here..."