hosted by liquidweb

Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Hosting Talk Tutorials : Web Design and Content Tutorials : Disable Hot-linking Files

Forum Jump

Disable Hot-linking Files

Reply Post New Thread In Web Design and Content Tutorials Subscription
Send news tip View All Posts Thread Tools Search this Thread Display Modes
Junior Guru Wannabe
Join Date: Apr 2010
Posts: 74

Disable Hot-linking Files


I'm using the following lines on my .htaccess:

RewriteCond %{HTTP_REFERER} !^http://(www\.)?*$ [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?

Sponsored Links
Community Leader
Join Date: Apr 2003
Location: London, UK
Posts: 3,778
Edit your last line to point wherever, something like;

RewriteRule \.(gif|jpe?g|bmp|txt|pdf)$ /folder/page.php [L,NC]
PS - wrong section

WHT Addict
Join Date: Sep 2011
Posts: 127
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ - [F,NC]

- I am a PHP developer. I'm not a webhosting owner, I have never run a webhosting business before.
- English is not my primary language.

Sponsored Links
Junior Guru Wannabe
Join Date: Jan 2013
Posts: 44
Why would you want to disable hot linking? As far as I can least at the time of writing, a hot linked image is beneficial in comparison to it being hosted. I believe that images that are hosted on other websites gives some "value" back in terms of SEO value.


Similar Threads
Thread Thread Starter Forum Replies Last Post
How-to - Disable Hot-linking Files. MjrGaelic Web Design and Content Tutorials 17 05-26-2010 09:23 PM
Disable Hot Linking on a Server Level tommyd Dedicated Server 4 05-18-2005 06:48 AM

Related posts from
Title Type Date Posted
Dutch File-Sharing Company WeTransfer Raises $25M to Expand in US Web Hosting News 2015-02-20 13:43:00
The Pirate Bay Uploads Continue to Grow Despite Anti-Piracy Pressure Web Hosting News 2013-12-31 11:33:12
BitTorrent Sync Announces Platform Updates, 1M+ Users Web Hosting News 2013-11-06 13:36:26
Egnyte Synchronizes Google Drive with Private Cloud Storage Web Hosting News 2013-07-17 12:36:21
Malwarebytes Launches Data Scan-and-Backup Service Web Hosting News 2013-05-07 14:51:03

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Log in with your username and password

Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Web Hosting News:
WHT Membership
WHT Membership



Welcome to

Create your username to jump into the discussion! is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.

(4 digit year)

Already a member?