我有一些麻烦配置.htaccess文件来保护文件的访问。 保护的文件是: www.mydomain/admin/stats.php
I'm having some troubles configuring the .htaccess file to protect the access of a file. The file to protect is: www.mydomain/admin/stats.php
我把.htaccess文件到www.mydomain/admin文件夹下面的code:
I put the .htaccess file into the www.mydomain/admin folder with the following code:
AuthName "Restricted Area" AuthType Basic AuthUserFile / <Files stats.php> require valid-user </Files>
该文件。htpasswd的是到www.mydomain/admin文件夹,也和它包含的用户名和密码。
The file .htpasswd is into the www.mydomain/admin folder too and it contains the username and the password.
如果我尝试进入www.mydomain/admin/stats.php~~V我得到一个内部服务器错误。我认为错误可以分为的AuthUserFile的路径,但我怎么能告诉文件保护的文件是在htpasswd的同一文件夹?
If I try to access to www.mydomain/admin/stats.php I get an "Internal Server Error". I think that the mistake can be into the path of "AuthUserFile" but how can I tell the file that the file to protect is in the same folder of the .htpasswd?
服务器的基于Linux的。
The server is Linux based.
推荐答案我想你需要把完整路径htpasswd的文件: IE浏览器。
I think you need to put complete path to htpasswd file: Ie.
的AuthUserFile /家庭/ -user - / - 网站 - 。/ htpasswd的
AuthUserFile /home/-user-/-site-/.htpasswd
更多推荐
保护文件的.htaccess和htpasswd的
发布评论