vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Programming Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=188)
-   -   Hotlink Protection Tutorial (Apache Server - .htaccess files) (https://vborg.vbsupport.ru/showthread.php?t=122057)

aacircle 01-20-2007 12:26 PM

Interesting feedback and I thought u would be replying quickly based on your excellent support.

Take a look at my signature which I do notice redirects to my home page even though it's a hotlinked image. Whereas, http://www.myotherdomain.com/test.htm shows a broken image.

NeutralizeR 01-20-2007 04:27 PM

Quote:

Originally Posted by aacircle (Post 1163411)
Interesting feedback and I thought u would be replying quickly based on your excellent support.

Take a look at my signature which I do notice redirects to my home page even though it's a hotlinked image. Whereas, http://www.myotherdomain.com/test.htm shows a broken image.

Where do you use this .htaccess file?

on www.animeonline.net or www.myotherdomain.com/test.htm?

For www.animeonline.net:
Code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://www.animeonline.net/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.animeonline.net$      [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|swf|mp3|mpeg|mpg|ram|rm|wma|wav|asx|wmv|avi|mov|zip|rar|exe)$ http://www.animeonline.net/ [R,NC]

If you delete RewriteCond %{HTTP_REFERER} !^$ line, the files will be accessible via empty referrers (like copying and pasting the urls directly to browser's address line or the IM windows)

Sorry, i'm too busy with my server problems at the moment :(

aacircle 01-21-2007 12:27 AM

It was placed into the .htaccess file at animeonline.

Anyway, it was just a little thing, so don't worry about it. Cheers and good luck with ur own issues.

adwade 02-01-2007 12:06 PM

How does one KNOW this is occurring? Is there some server parameter you're monitoring, or a utility that alerts you to the fact others are hotlinking to your site?

EyeCrave 03-09-2007 02:11 AM

Quote:

Originally Posted by Lionel (Post 1110269)
Guest are allowed to see attachments. But I found a solution that works perfect for me. Attachment.php displays on my site only.

How did you do this? We currently have a forum where we post images we use on our mainpage and we get the majority of our guests there. I need to be able to show it only on my site.

EyeCrave 03-13-2007 01:09 AM

Can someone help me with this... I'm getting hammered with people using my attachment.php link...

vietdjclub 01-17-2008 11:26 PM

if user use IDM when they click then it not rewrite

ex: http://abc.xom/folder/a.mp3

if use IDM then user can download it

attroll 03-21-2008 01:54 AM

Here is the code I have been using. It works without the www in front of the name but when I use the www then the hotlink protection does not work.

Does anyone have any advice?
Code:


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://mysite.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.net$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.net$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]


NeutralizeR 03-21-2008 05:00 AM

Quote:

Originally Posted by attroll (Post 1470316)
Here is the code I have been using. It works without the www in front of the name but when I use the www then the hotlink protection does not work.

Does anyone have any advice?
Code:


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://mysite.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.net$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.net$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]


Are you using your domain with our without www?

If you only want to use it with "www":

Code:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mysite\.com
RewriteRule (.*) http://www.mysite.com/$1 [L,R=301]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com$      [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|swf|mp3|mpeg|mpg|ram|rm|wma|wav|asx|wmv|avi|mov|zip|rar|exe)$ http://www.mysite.com [NC,R,L]


attroll 03-21-2008 06:16 AM

Quote:

Originally Posted by NeutralizeR (Post 1470440)
Are you using your domain with our without www?

If you only want to use it with "www":

Code:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mysite\.com
RewriteRule (.*) http://www.mysite.com/$1 [L,R=301]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com$      [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|swf|mp3|mpeg|mpg|ram|rm|wma|wav|asx|wmv|avi|mov|zip|rar|exe)$ http://www.mysite.com [NC,R,L]


My domain is setup so that it works with and without the "www". How can I set it up to with with and without the "www"?


All times are GMT. The time now is 07:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01527 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete