在GoDaddy的Apache 1.3中如何显示404错误,而不是403错误? [英] How do I display 404 errors instead of 403 errors in godaddy's Apache 1.3?
问题描述
显然,在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错误。 在...的帮助下 <一href="http://stackoverflow.com/questions/1486304/is-there-a-way-to-force-apache-to-return-404-instead-of-403">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?
这篇关于在GoDaddy的Apache 1.3中如何显示404错误,而不是403错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!