httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Daniels <j...@texaslink.com>
Subject RE: Rewrite rule trouble
Date Sat, 19 Jan 2002 02:24:27 GMT
Hello Everybody ...

Im new at this list stuff .. but I have a need for help.

Im trying to write a set of rules to prevent hotlinking.


I try this

RewriteCond %{HTTP_REFERER}     !^http://www.atomichosts.com/   [NC]
RewriteCond %{HTTP_REFERER}     !^http://atomichosts.com/       [NC]
RewriteRule ^$          -       [F]

I've done a ton of variations on this but I cannot get any of them to work 
.. and yes the engine is On.

Any help will be of great value !!!

JEFF



At 03:33 PM 1/18/2002 -0500, you wrote:
>Appears to have done the trick. Thanks!
>
>At 01:03 PM 1/18/2002 -0500, you wrote:
>
>> > From: Mike Zimmerman [mailto:tarmon@spamcop.net]
>>
>> > In order for me to properly route my passed requests from Tux to
>> > Apache, I
>> > have to look at the HTTP_HOST variable as follows:
>> >
>> > RewriteMap  lowercase  int:tolower
>> > RewriteRule  ^/(.*)$  /var/www/html/${lowercase:%{HTTP_HOST}}/$1
>> >
>> > Our directories are created in the Tux virtual hosting fashion, where the
>> > domain - e.g. host.com -  is used as the directory, and Tux answers for
>> > both www.host.com and host.com automagically.
>> >
>> > The above rewrite works fine for host.com, but when www.host.com
>> > is called,
>> > the HTTP_HOST doesn't match up and the directory returned in the rewrite
>> > doesn't exist. I can't seem to figure out how to strip the www.
>> > off of the
>> > HTTP_HOST if it exists in order to match things up properly, even after
>> > reading through the rewrite user guides I've found.
>> >
>>
>>You should be able to use something like:
>>
>>RewriteMap lowercase int:tolower
>>RewriteCond ${lowercast:%{HTTP_HOST}} ^(www\.)?(.*)$
>>RewriteRule ^/(.*) /var/www/html/%2/$1
>>
>>Joshua.
>>
>>
>>---------------------------------------------------------------------
>>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
>>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>---------------------------------------------------------------------
>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
>For additional commands, e-mail: users-help@httpd.apache.org
>


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


Mime
View raw message