Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

Disable Hot-linking Files

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


lmzaldivar at gmail

Apr 23, 2012, 11:42 AM

Post #1 of 2 (219 views)
Permalink
Disable Hot-linking Files

Hi,

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?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


mark at catseye

Apr 23, 2012, 11:57 AM

Post #2 of 2 (208 views)
Permalink
Re: Disable Hot-linking Files [In reply to]

On April 23, 2012 14:42 , luis medrano <lmzaldivar [at] gmail> 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 [at] catseye


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.