Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-26-2003, 05:47 PM   #1
X37375787
Guest
 
Posts: n/a
Quick htaccess redirection question

This is how my current htaccess looks like

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://domain.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://xx.xx.xx.xx.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://xx.xx.xx.xx:80.*$ [NC]
RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.domain.com/error404.html
RewriteCond %{HTTP_REFERER} ^http://.+\.sex-top.ru/* [NC]
RewriteRule .*$ http://www.domain.com/error404.html



The first part is obviously for hotlink protection, and the second RewriteCondition/Rule combo should actually cause all traffic from sex-top.ru to get redirected to the error404.html page, however it is not working. Am I missing some arguments?

  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-26-2003, 05:52 PM   #2
X37375787
Guest
 
Posts: n/a
this just causes the hits from sex-top.ru to wait. It doesn't get redirected.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-26-2003, 06:03 PM   #3
Lane
Will code for food...
 
Join Date: Apr 2001
Location: Buckeye, AZ
Posts: 8,496
because your 404 file also has the protection and keeps forwarding, getting into an infinite loop
__________________
Lane is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-26-2003, 06:05 PM   #4
Madball
Confirmed User
 
Join Date: May 2002
Location: Oslo, Norway
Posts: 748
I was wondering the same thing. Currently, I use this .htaccess to redirect a certain domain:

setenvifnocase Referer "^http://www.leechingfuck.com" spam_ref=1

<FilesMatch "(.*)">
Order Allow,Deny
Allow from all
Deny from env=spam_ref
</FilesMatch>

This produces a 403, the 403 then sends this to my index.html, rather than a gallery page. My problem however is resources:

Those fucking leeches send me like 150k on a bad day & this bogs down on my server resulting in huge load situations.

Anybody with a better solution?
Madball is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-26-2003, 06:08 PM   #5
X37375787
Guest
 
Posts: n/a
I'll just place the 404 on another domain then.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-26-2003, 09:20 PM   #6
fiveyes
Confirmed User
 
Join Date: Aug 2001
Location: New Orleans
Posts: 1,680
Quote:
Originally posted by Madball
I was wondering the same thing. Currently, I use this .htaccess to redirect a certain domain:

setenvifnocase Referer "^http://www.leechingfuck.com" spam_ref=1

<FilesMatch "(.*)">
Order Allow,Deny
Allow from all
Deny from env=spam_ref
</FilesMatch>

This produces a 403, the 403 then sends this to my index.html, rather than a gallery page. My problem however is resources:

Those fucking leeches send me like 150k on a bad day & this bogs down on my server resulting in huge load situations.

Anybody with a better solution?
Take the code out of .htaccess and place it into access.conf. Then it will be read and parsed only when apache starts instead of every request that comes in. Big savings that!

In fact, the only .htaccess files on a dedicated box should be temporary test files. Once the code is working properly, it should be transferred on into access.conf. Place it appropriately within a vitual host, directory or file block to control it's usage.
__________________
<CENTER><A HREF="http://www.hot-off-bourbon.com/" target="_blank"><IMG SRC="http://www.hot-off-bourbon.com/images/hob-logosmall.jpg" border="0"></A>

<FONT face="Comic Sans MS" SIZE="-1"><I>Mardi Gras, Spring Break, Wet-T, Night Club Action, UpSkirt, Oil Wrestling, Voyeur</I></FONT></CENTER>
fiveyes is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-26-2003, 09:54 PM   #7
fiveyes
Confirmed User
 
Join Date: Aug 2001
Location: New Orleans
Posts: 1,680
Oh, and for the greatest boost in performance, once you've cleared out your .htaccess files and placed their code within access.conf, you can stop having Apache look for them!

Just find the line in access.conf that starts with "AllowOverride", comment it out (place a "#" w/o the quotes in front of the line) and on the next line add: "AllowOverride None" (w/o the quotes). Whenever you do need to test new code, delete the "#" from the start of the original line and add it to the front of "AllowOverride None".

This is a tremendous performance boost, because if the server is expecting .htaccess files on your system, each and every request that comes in results in it looking for one, starting from the top-most directory above and working it's way down to where the file resides.

If you're smart enough to get rid of those .htaccess files, tell your server that there's no need to look for 'em anymore!
__________________
<CENTER><A HREF="http://www.hot-off-bourbon.com/" target="_blank"><IMG SRC="http://www.hot-off-bourbon.com/images/hob-logosmall.jpg" border="0"></A>

<FONT face="Comic Sans MS" SIZE="-1"><I>Mardi Gras, Spring Break, Wet-T, Night Club Action, UpSkirt, Oil Wrestling, Voyeur</I></FONT></CENTER>
fiveyes is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-27-2003, 07:28 AM   #8
Madball
Confirmed User
 
Join Date: May 2002
Location: Oslo, Norway
Posts: 748
Man, thanks for the advice. I will do exactly that!
Madball is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.