RE: FilesMatch/Files problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Emil Edeholt <mailto:emil@xxxxxxxxxxxx> wrote:
> Hi,
> 
> The pages on my site is accessed via index.php?page=foo where
> foo is the file.
> 
> All pages that starts with admin_ should require a password.
> I've tried to do this:
> 
> <FilesMatch "$page=admin_$">

http://httpd.apache.org/docs/2.2/mod/core.html#filesmatch
FilesMatch uses a regexp as parameter. In a regexp, $ means EOL. So,
your rexexp matches EOL, followed by "page=admin_" and an EOL. So, this
will never match.

Try: <FilesMatch "\?page=admin_">
(Not tested, not a regexp guru: not sure if \ is needed before ? here)

> and this
> 
> <Files "*page=admin_*">

To make this a regexp: <Files ~ "\?page=admin_">
(Same story here.)

According to the documentation FilesMatch is preferred for regexps.

> But neither seems to work. If I write <Files index.php*> I
> can't access any page on my site so the rest of the config seems
> fine. I have a vague guess that this doesn't work since the
> page=foo not is an actual file name but a parameter to the
> index.php file. Is that why it won't work?

In my log I see lines that contain "GET /music_download.php?id=912" so I
would say you should be able to match the complete url.
If the above works for you, you might look into regular expressions (you
don't have to be a guru to make them useful).


Grts,
Rob


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux