Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2005-05-24, 09:59 AM   #1
Lemmy
You can now put whatever you want in this space :)
 
Lemmy's Avatar
 
Join Date: Sep 2004
Location: Next door to a kid with a moped.
Posts: 1,492
.htaccess problem

So I tried to prevent hotlinking of my mpegs with .htaccess and when i tried to play the movies on the site I got an error msg from WMP saying the server was busy and could not connect. The page loaded fine.

This is my .htaccess document:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.quantumporn.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://quantumporn.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.quantumporn.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.we-r-sex.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://we-r-sex.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.we-r-sex.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.planetofporn.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://planetofporn.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.planetofporn.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.lustylemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://lustylemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.lustylemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.whothefuckislemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://whothefuckislemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.whothefuckislemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.desktopwanker.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://desktopwanker.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.desktopwanker.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://google.com/.*$ [NC]
RewriteCond %{REMOTE_ADDR} !^68\.169\.210\.217$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|mp3|mpg|mov)$ - [F,NC]

Options -Indexes

Order Allow,Deny
Allow from all
Deny from flabber.nl
Deny from in.ua
Deny from chatropolis.com
Deny from cs7.chatropolis.com
Deny from forumer.com
Deny from link0777.com
Deny from reapersbondage.com
Deny from urban.ne.jp
Deny from dongtaiwang.com
Deny from fn.com.ua
Deny from chatcannon.de
Deny from monik.cz
Deny from adultchatnetwork.com
Deny from sexloupe.com
Deny from zhonghua999.com
Deny from 212.83.120.133
Deny from fn.in.ua

And this is the movie page: http://desktopwanker.com/freesites/m...gallery_01.htm

I really can't see anything wrong with it, but then I really don't know what I'm doing. I just pieced together the .htaccess from an online tutorial. Can somebody help out?

BTW the movies are working now, I took down the .htaccess.

Thanks
__________________
BUY MY PORNSITES!
Lemmy is offline   Reply With Quote
Old 2005-05-24, 10:12 AM   #2
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
First of all, you are doing:

deny from .domain.com

This may not do what you think it does especially since I see some names in there that are probably meant to block hotlinking from those sites in particular.

But, that's not where this particular .htaccess rule is killing you. Because you have a deny from .domain.com, you are forcing apache to do a reverse DNS lookup on EVERY request for every file served under that .htaccess.

If you get hit with a ton of hotlinking, apache waiting for the DNS resolution will hold open threads and possibly exceed maxclients while it is trying to see if it should allow the person. I would bet if you removed the deny from statements, while it isn't the best set of rules, the machine would run much better and you would be rid of your server busy messages.

Exceeding MaxClients will give the Server Busy message.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-05-24, 10:21 AM   #3
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
http://desktopwanker.com/freesites/m...gallery_01.htm
Movies play for me.
Using Safari with QuickTime.
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2005-05-24, 10:33 AM   #4
Lemmy
You can now put whatever you want in this space :)
 
Lemmy's Avatar
 
Join Date: Sep 2004
Location: Next door to a kid with a moped.
Posts: 1,492
I tried what you said cd34 and trimmed the .htaccess to this:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.quantumporn.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://quantumporn.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.quantumporn.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.we-r-sex.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://we-r-sex.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.we-r-sex.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.planetofporn.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://planetofporn.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.planetofporn.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.lustylemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://lustylemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.lustylemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.whothefuckislemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://whothefuckislemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.whothefuckislemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.desktopwanker.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://desktopwanker.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.desktopwanker.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://google.com/.*$ [NC]
RewriteCond %{REMOTE_ADDR} !^68\.169\.210\.217$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|mp3|mpg|mov)$ - [F,NC]

And the same thing happens "Windows Media Player cannot connect to the server. The server name may be incorrect or the server is busy. Try again later."

Cleo, they played because I took down the .htaccess. I'm not leaving it there as long as it fucks things up.
__________________
BUY MY PORNSITES!
Lemmy is offline   Reply With Quote
Old 2005-05-24, 10:37 AM   #5
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
Do a test directory with a page of movies and your htaccess.

This is how I do mine and it seems to work without problems, scroll about 2/3 of the ways down on the page.
http://www.cleos-porn-links.com/adul...aster-help.php
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2005-05-24, 10:43 AM   #6
Lemmy
You can now put whatever you want in this space :)
 
Lemmy's Avatar
 
Join Date: Sep 2004
Location: Next door to a kid with a moped.
Posts: 1,492
Quote:
Originally Posted by Cleo
Do a test directory with a page of movies and your htaccess.

This is how I do mine and it seems to work without problems, scroll about 2/3 of the ways down on the page.
http://www.cleos-porn-links.com/adul...aster-help.php
Good idea. Makes it easier to identify the problem without crippling all my movie sites.
__________________
BUY MY PORNSITES!
Lemmy is offline   Reply With Quote
Old 2005-05-24, 10:55 AM   #7
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
oh, haha, sorry. Put this at the top.

RewriteCond %{HTTP_REFERER} !^$ [NC]

Windows Media Player does not send a referrer.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-05-24, 10:59 AM   #8
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
I just came back to the computer to post that mine, unlike yours, allows for no referral but I see that cd34 beat me to it.
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2005-05-24, 11:42 AM   #9
Lemmy
You can now put whatever you want in this space :)
 
Lemmy's Avatar
 
Join Date: Sep 2004
Location: Next door to a kid with a moped.
Posts: 1,492
Quote:
Originally Posted by cd34
oh, haha, sorry. Put this at the top.

RewriteCond %{HTTP_REFERER} !^$ [NC]

Windows Media Player does not send a referrer.
Should that line be instead of, or in addition to

RewriteCond %{HTTP_REFERER} !^$

Either way Cleo's code produces a 404, BUT it works fine on a different server so I'm beginning to think that this has something to do with the server configuration. I'm getting in touch with support at my host.

Thanks guys!
__________________
BUY MY PORNSITES!
Lemmy is offline   Reply With Quote
Old 2005-05-24, 11:49 AM   #10
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
[NC] - ignore case

So you do not need the NC on a line just telling it that no referral is ok.
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2005-05-24, 11:49 AM   #11
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.quantumporn.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://quantumporn.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.quantumporn.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.we-r-sex.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://we-r-sex.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.we-r-sex.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.planetofporn.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://planetofporn.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.planetofporn.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.lustylemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://lustylemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.lustylemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.whothefuckislemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://whothefuckislemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.whothefuckislemmy.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.desktopwanker.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://desktopwanker.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.desktopwanker.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://google.com/.*$ [NC]
RewriteCond %{REMOTE_ADDR} !^68\.169\.210\.217$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|mp3|mpg|mov)$ - [F,NC]

That should work.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-05-24, 12:11 PM   #12
Lemmy
You can now put whatever you want in this space :)
 
Lemmy's Avatar
 
Join Date: Sep 2004
Location: Next door to a kid with a moped.
Posts: 1,492
Thanks cd34, that works!
__________________
BUY MY PORNSITES!
Lemmy is offline   Reply With Quote
Old 2005-05-24, 12:18 PM   #13
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
my brain is mush this week re: the [NC] on the empty referrer.

Although, people with lowercase empty referrers might have been able to slip by with Cleo's rule.



Note: For the comedically and/or technically impaired, an empty referrer has no case. It is an attempt at humor. A poor attempt, but an attempt nonetheless to cover up for my sleep-deprived mushy brain.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Reply


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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:53 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc