保护文件的.htaccess和htpasswd的

编程入门 行业动态 更新时间:2024-10-27 08:36:48
本文介绍了保护文件的.htaccess和htpasswd的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一些麻烦配置.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的

本文发布于:2023-11-01 11:20:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549201.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   htaccess   htpasswd

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!