httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <>
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} !^*$ [NC]
> RewriteCond %{HTTP_REFERER} !^*$ [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
> 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.

Robert Andersson

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message