禁止重定向的IPS 404,而不是403 [英] Redirect banned IPs to 404 rather than 403

查看:128
本文介绍了禁止重定向的IPS 404,而不是403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的办公室内某个目录我只是想从访问。我有这方面的工作,并阻止就好了。以下是我在我的Apache的conf:

I have a certain directory I only want accessible from within my office. I have this working, and blocked just fine. Here is what I have in my apache conf:

<Directory /var/www/html/live/protected>
  Order deny,allow
  allow from 1.1.1.1.1.1 # My office ip
  deny from all
</Directory>

而不是创建一个自定义页面403,我宁愿只是给这些人到404页。有没有在Apache的一个方法可以让我有一个条件,如果他们不能在我的办公室来的IP,我可以将它们发送到404页我?

Rather than create a custom 403 page, I would rather just send these people to 404 pages. Is there a way in Apache I can have a conditional that if they are not coming from my office IP, I can just send them to the 404 page I have?

感谢

推荐答案

这也许可以帮助:

RedirectMatch 404 ".*\/\..*"

- > <一href=\"http://stackoverflow.com/questions/1486304/is-there-a-way-to-force-apache-to-return-404-instead-of-403\">Is有没有办法强制Apache在返回404,而不是403?结果
- > <一个href=\"http://stackoverflow.com/questions/548156/problem-redirecting-403-forbidden-to-404-not-found\">Problem 403重定向严禁404未找​​到

这篇关于禁止重定向的IPS 404,而不是403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆