Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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 LiteSpeed上的自定义403错误文档_.htaccess - Fatal编程技术网

.htaccess LiteSpeed上的自定义403错误文档

.htaccess LiteSpeed上的自定义403错误文档,.htaccess,.htaccess,我在IP上使用了一个白名单,因此我想告诉用户为什么会这样 order deny, allow deny from all allow from 24.11.95.152 HTACCESS中的我的IP白名单^ 现在,我将ErrorDocument设置为/403 ErrorDocument 403 /403 最后我将/403重写为uhoh.php RewriteEngine On RewriteRule ^403/?$ uhoh.php [NC] 但是,我仍然从LiteSpeed中得到典型的错

我在IP上使用了一个白名单,因此我想告诉用户为什么会这样

order deny, allow
deny from all
allow from 24.11.95.152
HTACCESS中的我的IP白名单^

现在,我将ErrorDocument设置为/403

ErrorDocument 403 /403
最后我将/403重写为uhoh.php

RewriteEngine On
RewriteRule ^403/?$ uhoh.php [NC]

但是,我仍然从LiteSpeed中得到典型的错误。

您可以将
ErrorDocument
直接用于您希望用于自定义消息的文件

在您的情况下,将如下所示:

ErrorDocument 403 /uhoh.php

从您的示例来看,您似乎在尝试双重重定向错误页面,而这并不是真正需要的。

@Prix Ah,好的。谢谢,成功了!:D@Prix是的,好主意。完成;)希望你一切顺利