[EMAIL PROTECTED] (Stefen Lars) writes:
> In the Apache config file, we have the following directive:
> SetEnvIfNoCase Referer "^http://www.oursite.com/" local_ref=1
> <FilesMatch ".(gif|jpg)">
> Order Allow,Deny
> Allow from env=local_ref
> We use this to prevent people from directly linking to .gif and .jpg
> However, we have to add more and more file types to the FilesMatch
> directive. Currently it looks like this:
> <FilesMatch ".(doc|zip|xls|exe|jpg|gif|png|psd|tif|tif)">
> However, this list continues to grow. And we can never be sure that
> every file type is included.
> It occurred to me that it would be better to say "do not serve any
> files except .htm, .html and .php files.".
> I have spent quite a long time with several regexes, but I am unable
> to create a regex that archives this seemingly simple talk.
How about this approach?
SetEnvIfNoCase Referer "^http://www.oursite.com/" local_ref=1
Allow from env=local_ref
Allow from all
I'd tighten up your regex slightly too. As it was it would match pretty
much any filename with those letters in it; The '.' matches any character
and it's not anchored to the end of the string.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]