![]() |
I need mod rewrite to deny all .edu domains
Or to redirect them to 404 page.... PLEASE help
Thanks! |
I think doing the lookup will hurt if you've got reasonable traffic
|
Quote:
Is it deny domain .edu ? |
Quote:
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. |
Quote:
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! |
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. |
Plus:
Code:
HostnameLookups On |
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? |
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