Post by bigweed » Sat Apr 28, 2012 10:54 pm

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

New member

Posts

Joined
Mon Mar 12, 2012 5:12 am

Post by bigweed » Sat Apr 28, 2012 11:12 pm

Forgot to add, this issue wasnt present with 1.5.1.3, I have just installed a fresh copy of 1.5.2.1, and it is present there

Thanks

New member

Posts

Joined
Mon Mar 12, 2012 5:12 am

Post by MarketInSG » Sun Apr 29, 2012 2:58 pm

You rewrite before you authorise. Switch the codings the other way around.


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by bigweed » Mon Apr 30, 2012 12:45 am

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

New member

Posts

Joined
Mon Mar 12, 2012 5:12 am

Post by bigweed » Mon Apr 30, 2012 12:56 am

I have just tried to access the .htaccess protected location again, and it took me 10 attempts for the login to be accepted. Something is surely pretty bad here?

New member

Posts

Joined
Mon Mar 12, 2012 5:12 am

Post by bigweed » Tue May 08, 2012 2:26 am

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

New member

Posts

Joined
Mon Mar 12, 2012 5:12 am
Who is online

Users browsing this forum: Semrush [Bot] and 10 guests