【问题标题】:404 error when redirecting to a 403 page with .htaccess?使用 .htaccess 重定向到 403 页面时出现 404 错误?
【发布时间】:2013-03-07 03:36:47
【问题描述】:

我收到 404 问题:

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. 

我的 .htaccess 看起来像这样。我的 .htaccess 和 index.html 位于“bar”文件夹中:

 ErrorDocument 403 /public_html/foo/bar/errorpages/403.html

order deny,allow

deny from all

allow from 123.456

我的错误页面中也有一个 .htaccess:

order deny,allow
allow from all

我是不是重定向错了?

更新

我也试过把目录改成

/bar/errorpages/403.html

但还是同样的问题:(

【问题讨论】:

    标签: html .htaccess


    【解决方案1】:

    尝试使用

    order allow, deny
    

    改为。

    看例子here

    【讨论】:

    • 对不起,这没有做任何事情。我的 .htaccess 和我的 index.html 在同一个文件夹中,这会导致冲突吗?
    • 不,可以将它们放在同一个文件夹中。
    • 修改htaccess文件后是否重启了Apache服务?我不确定这是否有必要;在更改 http.conf 之后,我不得不这样做。
    • 是的,但这对我来说似乎不是问题,您还有其他解决方案吗?这已经困扰了我好几个小时了
    • 您可以查看stackoverflow.com/a/12456158/2079606;看起来 httpd.conf 文件中存在问题导致该问题。
    猜你喜欢
    • 1970-01-01
    • 2023-03-10
    • 2018-04-18
    • 2013-06-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-15
    • 2015-08-22
    相关资源
    最近更新 更多