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)

MrOnline 10-01-2006 07:49 AM

when i try this all i get is
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@tvandsportstreams.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

NeutralizeR 10-01-2006 03:31 PM

Quote:

Originally Posted by MrOnline
when i try this all i get is
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@tvandsportstreams.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

There must be a misspelling or an extra space in your .htaccess file.
Please paste the contents of your .htaccess file here.

MrOnline 10-01-2006 07:04 PM

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://www.tvandsportstreams.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.tvandsportstreams.com$ [NC]
RewriteRule .*\.(mp3|mpeg|mpg|ram|rm|wma|wav|asx|wmv|avi|mov|z ip|rar|exe)$ http://www.tvandsportstreams.com/forum/ [F,NC]

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

had a better look and changed it to the following

Code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://www.tvandsportstreams.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.tvandsportstreams.com$ [NC]
RewriteRule .*\.(mp3|mpeg|mpg|ram|rm|wma|wav|asx|wmv|avi|mov|zip|rar|exe)$ [F,NC]

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


NeutralizeR 10-01-2006 08:50 PM

So, is it working now?

This is mine (in httpd.conf):
Code:

Options All -Indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.msxlabs\.org
RewriteRule (.+) http://www.msxlabs.org%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.msxlabs.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.msxlabs.org$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|swf|mp3|mpeg|mpg|ram|rm|wma|wav|asx|wmv|avi|mov|zip|rar|exe)$ http://www.msxlabs.org/forum/ [R,NC]
ErrorDocument 404 /forum/ [R=301,L]


MrOnline 10-01-2006 09:13 PM

if i was to use it in .conf file, should i then have it in apaceh.conf ??

Kinda noob in linux world :-)
And will it interfer with other sites hosted on same server if i do it in root ?
Not sure where i can do it or what to do if there are more than 1 site i will protect for this..

Delphiprogrammi 10-01-2006 09:38 PM

Quote:

Originally Posted by MrOnline
if i was to use it in .conf file, should i then have it in apaceh.conf ??

Kinda noob in linux world :-)

no httpd.conf and you have to be "root" to able to access that file

MrOnline 10-02-2006 06:08 PM

i have a bunch of "apache2" services runing when i do ps -A, but no httpd

and the httpd.conf is more or less empty while the apache2.conf hold all information about the server.... And yes it's as root i try..

rolandogomez 10-02-2006 06:49 PM

Thanks, again, I'm not a coder, but I did what you said and it worked. Now one more question, say I want to allow www.domainx.com, www.domainy.com and www.domainz.com how would I do this?

On another note, does it matter if we put http://domain.com or http://www.domain.com or for that matter http://mparton.domain.com ?

Thanks again, rg sends!

NeutralizeR 10-02-2006 08:21 PM

Quote:

Originally Posted by rolandogomez
Thanks, again, I'm not a coder, but I did what you said and it worked. Now one more question, say I want to allow www.domainx.com, www.domainy.com and www.domainz.com how would I do this?

Please check the first post, this's already been stated:
Quote:

You should add these extra two lines for each domain you want to allow:
Quote:

Originally Posted by rolandogomez
On another note, does it matter if we put http://domain.com or http://www.domain.com or for that matter http://mparton.domain.com ?

Thanks again, rg sends!

Yes it does.

So you can use this line instead:
Code:

RewriteCond %{HTTP_REFERER} !^http://(.+\.)?allowed\.com/ [NC]
For more information:
http://altlab.com/htaccess_tutorial.html

rolandogomez 10-03-2006 04:57 AM

ok, call me an idiot, but can you show me the "whole" code for this scenario,

1. I need to let my domain, plus it's subdomains (example: http://www.domain.com, http://domain.com, http://extra.domain.com).

2. I also need the ability to pass through to other domains, so they can use images off my server. Example, http://www.domainguest1.com, http://www.domainguest2.com, and http://www.domainguest3.com

Again, my apologies, I just don't see what you're explaining. Any help is greatly appreciated, thanks, rg sends!


All times are GMT. The time now is 02:08 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.01271 seconds
  • Memory Usage 1,747KB
  • 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
  • (3)bbcode_code_printable
  • (5)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