简体   繁体   中英

.htacces path to .htpasswd causing internal server error

So i've tried pretty much every path possible but every time i'm getting an internal server error, maybe i'm overlooking something anyone has an idea?

path to .htacces: /domains/domain.com/public_html/route/portfolio/inc

path to .htpasswd /domains/domain.com/public_html/route/portfolio/inc/etc

htacces:

AuthUserFile /public_html/route/portfolio/inc/etc
AuthName "Please Enter Password"
AuthType Basic
Require valid-user

Thanks in advance !

From the official documentation :

The AuthUserFile directive sets the name of a textual file containing the list of users and passwords for user authentication. File-path is the path to the user file. If it is not absolute, it is treated as relative to the ServerRoot.

In your case the path is treated as absolute, because it starts with /. You must change it to /domains/domain.com/public_html/route/portfolio/inc/etc or ./public_html/route/portfolio/inc/etc .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM