If you are familiar with cpanel web host, then I am sure you have tried the Password Protect feature that usually would work. But it seems when we try to use that on the admin folder, it just causes a problem with the cart.
So here is one solution .. oh, take your time reading this.
I don't think I missed a step. If I did I will edit and correct it where needed.
You first need to edit the .htaccess file in the admin folder.
If it is not there, create it and add this code in the file:
Code: Select all
AuthName "admin"
AuthUserFile "/home/SITEDIR/.htpasswds/public_html/admin/passwd"
AuthType Basic
require valid-user
ErrorDocument 401 "Not Allowed"
If your directory layout/structure is different, just adjust it accordingly to your server layout
Now you need to go to /.htpasswds/public_html/admin/ and make a file called passwd (no extension, JUST passwd)
Edit this new created file
Now head over to http://www.htaccesstools.com/htpasswd-generator/ - you will need to generate a username and password on this website and just copy the data into that passwd file.
So for example if you put in the fields:
username: test
password: pass
press create and you should see something like this:
Code: Select all
test:$apr1$ATAGGGta$oY9/Q3EZGCbOGhgx6QcYY/
save that.
now go to your admin panel and either refresh if you are already there or load it up and you SHOULD get the pop up asking you for a username and password. put in the info you used to generate the code and you should see the admin page or the admin login panel like usual, and there shouldn't be any issues viewing the admin panel or the store front.
You can change
Code: Select all
ErrorDocument 401 "Not Allowed"
Code: Select all
Not Allowed
Well, there you have it.
Note: the first line of code:
Code: Select all
AuthName "admin"
To do all of this, i used WinSCP software to move around the directories and create the files I needed above. You can edit files and save it right back to the server using WinSCP. It is pretty nice.