1

I have a filesmatch directive in my .htaccess file:

<filesMatch "admin"> AuthUserFile /var/www/html/.htpasswd AuthType Basic AuthName "Protected Area" require valid-user </filesMatch> 

It matches http://www.website.com/admin (and sub-pages such as /admin/edit_page)

But not http://www.website.com/index.php/admin

(I also have a mod_rewrite rule to hide the index.php from most of the website, don't know if this conflicts).

The mod rewrite rule:

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #Removes access to the system folder by users. #Additionally this will allow you to create a System.php controller, #previously this would not have been possible. #'system' can be replaced if you have renamed your system folder. RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] #Checks to see if the user is attempting to access a valid file, #such as an image or css document, if this isn't true it sends the #request to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> 
1
  • It would help if you posted the mod_rewrite rule as well; it's impossible to see any conflicts otherwise. Commented Jul 5, 2012 at 10:27

1 Answer 1

3

FilesMatch matches physical filesystem objects. index.php/admin is not one of those.

2
  • Is there a directive which would match a generic "admin" path? Commented Jul 5, 2012 at 12:48
  • Well caught! I've not tried it, but LocationMatch might work. Commented Jul 5, 2012 at 14:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.