通过404,而不是403拒绝

编程入门 行业动态 更新时间:2024-10-23 18:27:39
本文介绍了通过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 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拒绝

本文发布于:2023-10-31 15:43:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546537.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不是

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!