2015-08-22 60 views
0

我累实施httaccess密码保护我的WordPress网站,用户需要看到我的网站进入htaccess的用户名和密码后,我用下面的代码,它显示密码输入框,WordPress的使用httaccess密码保护的网站

我htaccess文件

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 

# END WordPress 
AuthName "Restricted Area" 
AuthType Basic 
AuthUserFile .htpasswd 
AuthGroupFile /dev/null 
require valid-user 
<Files 403.shtml> 
order allow,deny 
allow from all 
</Files> 

deny from 141.101.99.132 
deny from 173.245.53.65 
deny from 173.245.53.74 

但之后进入密码这表明服务器错误消息

Internal Server Error 

The server encountered an internal error or misconfiguration and was unable to complete your request. 

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. 

More information about this error may be available in the server error log. 

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. 

我的网站是http://www.daqta.com/ü sername-test,password-test

有人知道这个问题,请帮帮我。

+0

你能不htaccess的访问的网站?如果站点在端口80上运行,您是否可以删除密码提示并能够访问它?你将能够追踪到apache配置错误或htaccess错误。看起来像Apache的尝试写入错误日志,但不能 –

+0

是当我删除htaccess的从网站上的密码代码运行正常“AuthName指令‘禁区’ 基础进行AuthType 的AuthUserFile htpasswd的 目录AuthGroupFile的/ dev/null的 需要有效─用户“ –

+0

您在/ var/log/httpd/logs中是否收到任何错误消息?我会在access_log看看,以确保你看到访问请求,然后error_log看到任何额外的细节 –

回答

0

在你的apache配置中使用类似于这个的东西。

<Location /> 
    AuthType Basic 
    AuthName "username" 
    AuthUserFile /etc/httpd/htpasswd 
     Require valid-user 
</Location> 

这里,/ etc/httpd的/ htpasswd的是一个密码文件