httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <rob...@profundis.nu>
Subject Re: [users@httpd] Mod-rewrite
Date Tue, 09 Dec 2003 06:16:07 GMT
Selmer Ausland wrote:
> RewriteEngine on
> RewriteCond %{HTTP_REFERER} !^$
> RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$ [NC]
> RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$ [NC]

You could combine the last two into the expression:

    RewriteCond %{HTTP_REFERER} !^http://[^.]*\.?mydomain\.com/ [NC]

> RewriteRule .*\.(gif|GIF|[...snip...]|mpeg|MPEG)$ - [F]

You could (and should) use the NC flag here as well:

    RewriteRule \.(gif|jpg|mid|wav|mp3|avi|mpeg)$ [NC,F]

> Is this setup feasable?

I think so.

> Can I add it to my main httpd config file, or, should it be set up on a
per
> VH, or, Directory basis?

To whatever context you want it to apply. Do you want these rules to apply
to all requests to the server, then by all means put in in the main server.
Or, if you want it only on particular hosts or directories, then place the
rules there.

Regards,
Robert Andersson


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message