在GoDaddy的Apache 1.3中如何显示404错误,而不是403错误?错误、而不是、Apache、GoDaddy

2023-09-02 00:46:05 作者:旧戏文

显然,在Apache 1.3所使用的任何人,除非GoDaddy的现在,我似乎无法找到任何相关信息这一点。

Apparently Apache 1.3 is used by no one except godaddy by now as I can't seem to find any relevant information for this.

我想使用.htaccess文件拒绝到我的网站上的某些文件,但没有让攻击者知道存在这样的文件,所以我想显示的404找不到文件的错误,而不是直接访问403禁止错误。

I'd like to use .htaccess files to deny direct access to certain files on my site but without letting attackers know that such a file exists so I'd like to display a 404 "file not found" error instead of a 403 "forbidden" error.

推荐答案

添加以下code。在.htacess文件。

Add following code in .htacess file.

RedirectMatch 404 ".*/..*"

这将禁止访问所有文件或启动以点目录,给人一种404 Not Found错误。 在...的帮助下 Is有没有办法迫使阿帕奇返回404,而不是403?

it will prohibit access to all files or directories starting with a dot, giving a "404 Not Found" error. with the help of Is there a way to force apache to return 404 instead of 403?

 
精彩推荐
图片推荐