通过404,而不是403拒绝 [英] Denying via 404 instead of 403

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

问题描述

我有phpmyadmin的以下设置:

I have the following setup for phpmyadmin:

<Directory /usr/share/phpmyadmin>
        Options FollowSymLinks
        DirectoryIndex index.php
        Order Deny,Allow
        Allow from 127.0.0.1
        Deny from all

...

</Directory>

所以基本上,我只允许phpmyadmin的是从本地主机访问。如果从外界有人试图去的http:// MYDOMAIN / phpMyAdmin的他们会得到一个403(禁止)。这可能会提示他们到过它的存在的事实,但他们只是无法得到它。

So essentially, I only allow phpmyadmin to be accessible from localhost. If someone from the outside world attempts to go to http://mydomain/phpmyadmin they'll get a 403 (Forbidden). This might tip them off to the fact it's there, but they just can't get to it.

问:我宁愿有阿帕奇在这种情况下返回404。这可能吗?

Question: I'd rather have Apache return a 404 in this instance. Is that possible?

推荐答案

我环顾四周互联网的答案,类似的问题。虽然mod_rewrite的是一个可能的解决方案,我觉得最好的解决方案采用了RedirectMatch指令。

I've looked around the internet for an answer to a similar problem. While mod_rewrite is a possible solution, I find the best solution uses the "RedirectMatch" directive.

请参阅StackOverflow:问题403重定向严禁404未找​​到

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

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