拒绝通过404而不是403

问题描述

| 我为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(禁止访问)。这可能会提示他们存在的事实,但是他们无法做到这一点。 问题:我希望Apache在此实例中返回404。那可能吗?     

解决方法

        我在互联网上四处寻找有关类似问题的答案。尽管mod_rewrite是一种可能的解决方案,但我发现最好的解决方案使用\“ RedirectMatch \”指令。 请参见StackOverflow:将403禁止重定向到404的问题未找到