You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Selmer Ausland <se...@shawcable.com> on 2003/12/06 06:11:47 UTC
[users@httpd] modrewrite use
Hello Group;
I am running Apache 2.0.48 on a Windows NT 4.0 server. I have a
number of name-based virtual hosts and directories. I would like to use
the following mod-rewrite rule to prevent others from linking to
graphics, .mid .wav .avi .mpegs from my server.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$ [NC]
RewriteRule
.*\.(gif|GIF|jpg|JPG|mid|MID|wav|WAV|mp3|MP3|avi|AVI|mpeg|MPEG)$ - [F]
Is this setup feasable? Can I add it to my main httpd config file, or,
should it be set up on a per VH, or, Directory basis?
I have set it up in my main httpd config file (Apache 2.0.48) on a test
server and it seems to work, at least Apache re-starts after I installed
it. Whether it prevents linking to my graphics is another question.
As you have probably guessed I am absolutely new to Mod Rewrite except
for what I have read in the docs.
Any comments, or, help would be appreciated.
Thanks. Selmer Ausland
---------------------------------------------------------------------
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