Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 为“所有”设置主页;选项-索引“;发生_.htaccess_Redirect_Http Status Code 404 - Fatal编程技术网

.htaccess 为“所有”设置主页;选项-索引“;发生

.htaccess 为“所有”设置主页;选项-索引“;发生,.htaccess,redirect,http-status-code-404,.htaccess,Redirect,Http Status Code 404,我已经在我的.htaccess文件中设置了一个选项-索引,我的大多数目录现在都有这个空白索引文件。有没有什么有效的方法可以将它重定向到我的404页面?或者在用户每次访问时为其设置主页?选项-索引会将403返回给您的客户端 然后,您可以拥有处理403的自定义页面: ErrorDocument 404 /forbidden.html 使用要在客户端浏览器中显示的自定义文本填充/planded.html

我已经在我的.htaccess文件中设置了一个
选项-索引
,我的大多数目录现在都有这个空白索引文件。有没有什么有效的方法可以将它重定向到我的404页面?或者在用户每次访问时为其设置主页?

选项-索引会将403返回给您的客户端

然后,您可以拥有处理403的自定义页面:

ErrorDocument 404 /forbidden.html
使用要在客户端浏览器中显示的自定义文本填充
/planded.html