Results 1 to 4 of 4
Thread: Disable Hot-linking Files
Hybrid View
-
04-23-2012, 02:40 PM #1Junior Guru Wannabe
- Join Date
- Apr 2010
- Posts
- 75
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?
-
04-23-2012, 02:57 PM #2Retired Moderator
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 4,721
Edit your last line to point wherever, something like;
Code:RewriteRule \.(gif|jpe?g|bmp|txt|pdf)$ /folder/page.php [L,NC]
-
04-23-2012, 03:14 PM #3WHT Addict
- Join Date
- Sep 2011
- Posts
- 128
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [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.
-
01-15-2013, 07:38 PM #4Junior Guru Wannabe
- Join Date
- Jan 2013
- Posts
- 46
Why would you want to disable hot linking? As far as I can tell...at 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
-
How-to - Disable Hot-linking Files.
By MjrGaelic in forum Web Design and Content TutorialsReplies: 17Last Post: 05-26-2010, 09:23 PM -
Disable Hot Linking on a Server Level
By tommyd in forum Dedicated ServerReplies: 4Last Post: 05-18-2005, 06:48 AM