httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <m...@catseye.org>
Subject Re: [users@httpd] Disable Hot-linking Files
Date Mon, 23 Apr 2012 18:57:55 GMT
On April 23, 2012 14:42 , luis medrano <lmzaldivar@gmail.com> wrote:
> I'm using the following lines on my .htaccess:
>
> RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com(/)?.*$ [NC]
> RewriteRule .*\.(gif|jpg|jpeg|bmp|txt|pdf)$ - [F,NC]
>
>
> I'm using this lines to avoid links to a files from external websites
> but how can I redirect that traffic to the index of the website or any
> other page?

Replace the "-" in the RewriteRule directive with the URL to which you 
want the users redirected.  For example,

RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|txt|pdf)$ http://www.example.com/somepage.html [F,NC]


--
   Mark Montague
   mark@catseye.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message