httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] anti hotlink
Date Fri, 25 Jun 2004 08:15:09 GMT
> -----Original Message-----
> From: List [mailto:list@nchost.net]
> Sent: Freitag, 25. Juni 2004 05:32
> To: users@httpd.apache.org
> Subject: [users@httpd] anti hotlink 
> 
> 
> Hi,
> 
> I am hosting some virtual websites of the company i am 
> working for and its
> branches. I am running on Redhat 9 and the root of the 
> virtual directory of
> the webpages is /home/www and directory of company1, company2 
> and company3
> as follows :-
> 
> /home/www/company1/html
> /home/www/company2/html
> /home/www/company3/html
> 
> I like to prevent hotlinking from all the 3 sites. I decided 
> to place a
> .htaccess file in /home/www with the contents:-

Do you have "AllowOverride" set to allow apache to act on the directives
in the .htaccess file? Either "AllowOverride All" or remove it entirely
(to rely on the default) or put the Rewrite directives into the config.

> 
> RewriteEngine on
> RewriteCond %{HTTP_REFERER} .
> RewriteCond %{HTTP_REFERER} !^http://(www\.)?company1\.com [NC]
> RewriteCond %{HTTP_REFERER} !^http://(www\.)?company2\.com [NC]
> RewriteCond %{HTTP_REFERER} !^http://(www\.)?company3\.com [NC]
> RewriteRule
> \.(gif|txt|doc|xls|exe|zip|rar|jpe?g|bmp|wm[av]|png|mpe?g|avi|
> mp4)$ - [F,L]

No obvious errors - if you're sure that that .htaccess is being read and
it still don't work, witch on the Rewrite Log and see what it says.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> 
> The .htaccess file permission, group and ownership as follows:-
> 
> -rw-r--r-- 1 apache apache
> 
> But hotlinking is still not disable. I guess apache is not reading
> /home/www/.htaccess. How can i make apache to read the .htaccess.
> 
> I do not wish to place the .htaccess file into the individual 
> directories.
> Is this possible?
> 
> 
> Best regards
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 
Diese E-mail ist eine private und persönliche Kommunikation. Sie hat
keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Gruppe. This
e-mail is of a private and personal nature. It is not related to the
exchange or business activities of the SWX Group. Le présent e-mail est
un message privé et personnel, sans rapport avec l'activité boursière du
Groupe SWX.

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



---------------------------------------------------------------------
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