![]() |
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 |
this just causes the hits from sex-top.ru to wait. It doesn't get redirected. :(
|
because your 404 file also has the protection and keeps forwarding, getting into an infinite loop
|
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? |
I'll just place the 404 on another domain then.
|
Quote:
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. |
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! |
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