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)
-   -   .htaccess HELP (https://gfy.com/showthread.php?t=77546)

sexyclicks 09-16-2002 04:18 PM

.htaccess HELP
 
I want to allow certain referers using .htaccess (or anything similar)

For example when the user is coming from mydomain1.com is allowed to enter but if coming from mydomain2.com is not....

Example:
Code:

<Limit GET>                                                               
order deny,allow
deny from all
referer allow from http://yourdomain.com/*
</Limit>

Am I crazy?

salsbury 09-16-2002 04:24 PM

you're not crazy, it'd be nice if it worked that way, but it's a bit more complex.

just a warning though: this isn't perfect. referrers are frequently broken or just plain missing. it's not really wise to only allow certain referers in unless you also allow null referers and some of those all x referers some software generates.

ok, with that said, here goes.

let's assume you just want to allow all referers in except one:

RewriteEngine on
RewriteCond %{HTTP_REFERER} http://www.baddomain.com/ [NC]
RewriteRule /* http://www.yahoo.com/ [R,L]

you can use ! in front of the http:// on the RewriteCond line to negate the conditional. check hotlink protection .htaccess rules for more details, or Apache's excellent guide http://httpd.apache.org/docs/misc/rewriteguide.html

Buck 09-16-2002 04:26 PM

AuthUserFile /dev/null
AuthGroupFile /dev/null

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://YOURDOMAIN.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.YOURDOMAIN.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.YOURIP/ [NC]
RewriteRule /* http://www.YOUR_DOMAIN.com/ [R,L]

some_idiot 09-16-2002 04:28 PM

Quote:

Originally posted by sexyclicks
I want to allow certain referers using .htaccess (or anything similar)

For example when the user is coming from mydomain1.com is allowed to enter but if coming from mydomain2.com is not....

Example:
Code:

Limit GET                                                             
order deny,allow
deny from all
referer allow from http://yourdomain.com/*
/Limit

Am I crazy?

You seem to have httpd.conf commands here not
htaccess.

If you want htaccess from a referrer, use the rewrite
conditional.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://*yourdomain.com/ [NC]
RewriteRule /* http://send.badguys.here.com/ [R,L]

... do you want the httpd.conf for doing similar?

sexyclicks 09-16-2002 04:34 PM

YOU GUYS ROCK!!!!

I am trying 1 hour reading shit like this one here http://accessreferer.sourceforge.net...#allow_referer and in less than 3 min my problem is solved from GFY crew!!!

:thumbsup :thumbsup

HQ 09-16-2002 06:21 PM

Keep in mind that anyone using Norton (and the likes) have their HTTP_REFERERs blocked (they are deleted and do not exist).


All times are GMT -7. The time now is 04:41 AM.

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