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)
-   -   I need mod rewrite to deny all .edu domains (https://gfy.com/showthread.php?t=485088)

Bladewire 06-25-2005 06:24 AM

I need mod rewrite to deny all .edu domains
 
Or to redirect them to 404 page.... PLEASE help

Thanks!

pudcat 06-25-2005 06:56 AM

I think doing the lookup will hurt if you've got reasonable traffic

Bladewire 06-25-2005 06:58 AM

Quote:

Originally Posted by pudcat
I think doing the lookup will hurt if you've got reasonable traffic

I just need to block all .edu domains via my .htaccess.... anyone know how?

Is it deny domain .edu ?

darksoul 06-25-2005 07:01 AM

Quote:

Originally Posted by Squirtit
I just need to block all .edu domains via my .htaccess.... anyone know how?

Is it deny domain .edu ?

By default apache gets only the ip of the visitor and not the hostname.
In order to block hostnames ending in .edu you'd have to reverse all the ips
that are visiting your sites.
Reverse resolution its a pretty slow process so like he said if you have lots
of traffic this isn't an option.
You're only escape would be a database like maxmind's (aka geoip database)
that has the .edu ips.

Bladewire 06-25-2005 07:14 AM

Quote:

Originally Posted by darksoul
By default apache gets only the ip of the visitor and not the hostname.
In order to block hostnames ending in .edu you'd have to reverse all the ips
that are visiting your sites.
Reverse resolution its a pretty slow process so like he said if you have lots
of traffic this isn't an option.
You're only escape would be a database like maxmind's (aka geoip database)
that has the .edu ips.


Ok so let's say I'm willing to sacrifice the process time to block all .edu domains... how do I do it?

I appreciate your help on this.. thanks!

fusionx 06-25-2005 07:20 AM

to redirect to a page:

RewriteEngine on
RewriteCond %{HTTP_HOST} *\.edu
RewriteRule ^(.*)$ http://www.yourdomain.com/404.html$1 [R,L]

to just drop the request:

RewriteEngine on
RewriteCond %{HTTP_HOST} *\.edu
RewriteRule ^(.*)$ - [L]

"should" work. You may need to tweak the RewriteCond string match.

darksoul 06-25-2005 07:28 AM

Plus:
Code:

HostnameLookups On
in your apache config.

Bladewire 06-25-2005 07:38 AM

OK thanks guys. Are you sure I have to do the hostnamelookups call?

So

HostnameLookups On [in the apache config] and

RewriteEngine on
RewriteCond %{HTTP_HOST} *\.edu
RewriteRule ^(.*)$ - [L]

in my .htaccess?

darksoul 06-25-2005 07:45 AM

Yes.
Just be warned that every visitor will have a small delay before reaching your
site while the ip address is resolved.


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

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