Welcome Guest, Not a member yet? Register   Sign In
Problem with htaccess password protecting a single page not working
#1

[eluser]Unknown[/eluser]
I've been struggling for a couple of hours and I don't seem to find the answer.
I've successfully protected 3 pages (called modify, activate and delete) inside my Codeigniter installation using htaccess so that it can't be seen unless you have a username and password.
It works if I write the URL as:
http://mypage.com/activate

but it doesn't as
http://mypage.com/?activate
http://mypage.com/index.php?activate

This is my htacess configuration (I'm currently using a Godaddy shared hosting)
Code:
RewriteEngine on
RewriteBase /codeigniter_folder/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

And this is my password protection segment inside the same htacess
Code:
AuthUserFile .htpasswd
AuthGroupFile /dev/null
AuthName "Username check"
AuthType Basic
<FilesMatch modify|delete|activate>
  require valid-user
</FilesMatch>

Is there any way to solve this?
Thank you!




Theme © iAndrew 2016 - Forum software by © MyBB