Results 1 to 4 of 4
  1. #1

    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?

  2. #2
    Join Date
    Apr 2003
    London, UK
    Edit your last line to point wherever, something like;

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

  3. #3
    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.

  4. #4
    Join Date
    Jan 2013
    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.

  5. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Similar Threads

  1. How-to - Disable Hot-linking Files.
    By MjrGaelic in forum Web Design and Content Tutorials
    Replies: 17
    Last Post: 05-26-2010, 09:23 PM
  2. Disable Hot Linking on a Server Level
    By tommyd in forum Dedicated Server
    Replies: 4
    Last Post: 05-18-2005, 06:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts