当有人提取存在的被拒绝的 URL时,他会得到:
Forbidden You don't have permission to access /admin/admin.php on this server. Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.9 with Suhosin-Patch Server
当有人去到一个不存在的URL时,他会得到:
Not Found The requested URL /notexisting/notthere.php was not found on this server. Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.9 with Suhosin-Patch Server
这样,有人可以find有关某个地区目录结构的信息,而这些信息实际上并不对公众开放。 这是真的?
如果我偏执,我该怎么办? 只是好奇。
你可能可以使用SetEnvIf来检查一些东西,比如Remote_Addr是否是内部的,然后使用mod_rewrite给出基于环境variables的404。
请注意,这并不一定告诉他们/admin/admin.php存在。 如果/admin被禁止, /admin /admin/notthere.php也将是403 Forbidden 。 所以它没有明确地提供任何关于你的目录结构的信息。
如果你偏执狂,你可以创build一个保护根的子域。 这样,对于未经授权的用户, 任何URL都将导致403 Forbidden消息
您可以configurationApache对错误的反应方式,例如通过为每个错误设置ErrorDocument: http : //httpd.apache.org/docs/2.0/mod/core.html#errordocument