Page 1 of 1

Does anyone use Zeus or Easyspace? Help

Posted: Wed Sep 25, 2002 4:20 pm
by f1nutter
I am trying to use .htaccess to prevent hotlinking to my images. I though my host, Easyspace, used Apache so set up .htacces accordingly, and it worked at home, but when I transfered to Easyspace it doesn't work because they use Zeus.

I have read the Zeus documentation which looks like a subset of Apache, with no Rewrite engine. So I am trying to prevent hotlinking using <Files> and having some curious results.

Code: Select all

<Files *>
 order deny,allow
 deny from all
 allow from "my-site"
</Files>
The first thing is my host doesn't seem to know its name! I set-up a php script to return some $_SERVER array entries. PHP_SELF worked, HTTP_HOST and SERVER_NAME returned nothing. But phpinfo() names these both as "www.f1nutter.com". I have tried all sorts of strings/expressions, even as loose as ^.*f1nutter.*$ which, I hope, matches anything with f1nutter in it.

The second problem is what to put in the <Files> directive. If I just put "deny from all" inside and wish to restrict every file I only get an error from <Files *> but if it uses regular expressions, shouldn't this be <Files .*>?

I guess what I am looking for will not look a million miles different from:

Code: Select all

<Files *.jpg>
 order deny,allow
 deny from all
 allow from ^.*www\.f1nutter\.com.*$
</Files>
It's made more frustrating by not being able to see error messages, and tracking this bug.

Cheers.

Posted: Wed Sep 25, 2002 4:43 pm
by volka
I'm not using Zeus (uhh, $1700 for a webserver ;) )

but "allow from <pattern>" you can imagine as "if (preg_match($pattern, $_SERVER['REMOTE_ADR']) > 0) $allowed = TRUE; else $allowed=FALSE;"
- so you only allow clients with your own domain-name getting the pictures.......

Posted: Wed Sep 25, 2002 5:02 pm
by nielsene
Try <Files ~*.jpg> or <FilesMatch *.jpg>, I don't have my apache reference in front of me, but is zeus is a subset, one of those might work...