Hi all
I have been reading up on ways to make my site more secure, and have decided to force the Admin page to load in HTTPS and also to protect the Admin area with a .htaccess password. I created a .htaccess file and saved it in the Admin folder. To login to the Admin area, when the .htaccess popup box comes up asking for a password, I have to enter it in there 3 or 4 times before the OC Admin login page appears. Not sure why, maybe it is because the .htaccess file asks for a password and also forces the Admin page to load as HTTPS? Can anyone help please? My .htaccess is as follows:
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/site/folder/.htpasswd
AuthGroupFile /dev/null
require valid-user
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.mysitedomain.co.uk/store/admin/ [R]
Thanks for all help
Naz
You rewrite before you authorise. Switch the codings the other way around.
Hi, thanks for that. I did as you suggested, but the .htaccess is still forcing me to login 3 or 4 times each time. Any other things it may be?
The .htaccess file is now:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.domain.co.uk/store/admin/ [R]
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/domain/htpasswdlocation/.htpasswd
AuthGroupFile /dev/null
require valid-user
Cheers
Naz
The .htaccess file is now:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.domain.co.uk/store/admin/ [R]
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/domain/htpasswdlocation/.htpasswd
AuthGroupFile /dev/null
require valid-user
Cheers
Naz
According to some advice from a friend, I have changed the .htaccess file to:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.domain.co.uk/store/admin/$1 [R]
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/domain/protectstore/.htpasswd
AuthGroupFile /dev/null
require valid-user
However, I am still having to enter the username and password multiple times before I can access the Admin area login page. Can anyone please help?
Thanks
Naz
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.domain.co.uk/store/admin/$1 [R]
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/domain/protectstore/.htpasswd
AuthGroupFile /dev/null
require valid-user
However, I am still having to enter the username and password multiple times before I can access the Admin area login page. Can anyone please help?
Thanks
Naz
Who is online
Users browsing this forum: Semrush [Bot] and 10 guests