Page 1 of 1

[Solved] Rewrite and Filesmatch

PostPosted: 02. April 2008 11:49
by oldjoe
Hi,

I am using a simple rewrite-rule in htaccess to rewrite dynamic pages with this syntax "index.php?page=pagename" into /pagename.

Now I am also trying to add password protection to pages with certain pagenames by using FilesMatch, like so:


<FilesMatch "^\custinfo">
AuthName "Enter password"
AuthType Basic
AuthuserFile "C:\htdocs\.passwd"
require valid-user
</FilesMatch>

But it does not seem to work. Can FilesMatch (or any other similar expression like Files or LocationMatch) be used to do this sort of thing in conjuction with rewrite?

Or does this behaviour needs to be written in php or otherwise?


EDIT: I apologize. Looks like I was a bit quick to turn the corner here.

I changed <FilesMatch "^\custinfo"> into <FilesMatch "^custinfo"> and now it seems to work fine. :D