我正在使用共享主机(apache、php、wordpress),在试图阻止访问.htaccess和wp-config的同时,我得到了
错误500 -内部服务器错误
我所做的就是把这些放到.htaccess中:
# protect the wp-config file
<files wp-config.php>
Order allow, deny
Deny from all
</files>
# Prevent access to .htaccess
<Files .htaccess>
Order allow, deny
Deny from al
尽管我有代码阻止对httpd.conf中隐藏文件的访问,但.htaccess等文件的内容在web浏览器中是可见的。
在Windows7和Windows SP3上运行服务器时也会出现同样的效果。
以下httpd.conf代码似乎并不有效:
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files "^\.ht*">
Order allow,deny
Deny from all
Satis
我有一个为我的网站提供服务的Apache服务器v2.4.43,我使用一个在.htaccess中调用的简单.htpasswd,使用指令"AuthUserFile <path to my .htpasswd file>“进行身份验证。
现在,该解决方案适用于所有浏览器(将显示一个弹出窗口,要求输入用户名/密码),除了Edge浏览器(基于Chromium build 84.0.522.52)。在显示要求您提供凭据的弹出窗口之前,它会抛出以下错误:
Unauthorized
This server could not verify that you are authorized