GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Quick htaccess redirection question (https://gfy.com/showthread.php?t=102767)

X37375787 01-26-2003 05:47 PM

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?

:helpme

X37375787 01-26-2003 05:52 PM

this just causes the hits from sex-top.ru to wait. It doesn't get redirected. :(

Lane 01-26-2003 06:03 PM

because your 404 file also has the protection and keeps forwarding, getting into an infinite loop

Madball 01-26-2003 06:05 PM

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?

X37375787 01-26-2003 06:08 PM

I'll just place the 404 on another domain then.

fiveyes 01-26-2003 09:20 PM

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.

fiveyes 01-26-2003 09:54 PM

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!

Madball 01-27-2003 07:28 AM

Man, thanks for the advice. I will do exactly that!


All times are GMT -7. The time now is 05:25 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123