sublok
1
how can I password protect a directory outside of the cs-cart
lets say www.sitename.com/directory/subdirect/
i have added in the .htaccess and .passwd files
added in htaccess
AuthType Basic
AuthName "Log In"
AuthUserFile /home/www/directory/subdirect/.passwd
Require valid-user
and in .passwd
confirmed server path however when i visit the www.sitename.com/directory/subdirect/
i only get a 404 error and not a prompt for login if i remove the .htaccess the page loads fine.
What am I missing?
Try to open the URL in other browser. Do you face the same issue?
sublok
3
Yep, tried chrome, ie and firefox with same issue.
Please contact server administrator in this case. I do not see any issues. Please keep us updated about the result
thetool
6
AuthType Basic
AuthName "Log In"
AuthUserFile "/home/user/.htpasswds/public_html/directory/subdirect/passwd"
require valid-user
sublok
7
AuthType Basic
AuthName "Log In"
AuthUserFile "/home/user/.htpasswds/public_html/directory/subdirect/passwd"
require valid-user
AuthUserFile /home/www/directory/subdirect/.passwd
I contacted my hosting company and they confirmed the correct path settings and the auth file location is good.
So its an issue with cs-cart 4.3.9,
sublok
8
So after some digging on this issue if anyone else has the same quandary, it appears that the cs-cart requires the
ErrorDocument 401 "output text"
to be included else it causes a redirect loop as it is not push to an "error" page.
I was able to secure a renamed admin page with the following.
AuthType Basic
AuthName "Login"
AuthUserFile /home/path/sub/.filename
require valid-user
ErrorDocument 401 "Required"
Just to add an extra layer of security. I would recommend that cs-cart add this to their core code htaccess with an append to the .htaccess file