![]() |
I need help with .htaccess (Filtering foreign countries)
If someone can post a link on how to make an htacess file to redirect all foreign countries that would be great.
or if someone can post their hta code here. Thanks! |
You can't use an htaccess file to do that (unless you wrote a custom script and used external auth, but I think thats a bit beyond the scope of a forum post).
|
nonsense.. I have seen it posted before and you list all the country extensions that you want to have the script redirect
|
If it's that easy - I would like to know too!
|
You can redirect by language easily enough.
Check out http://www.htaccesstools.com/redirection-by-language/ |
http://www.maxmind.com/app/geoip_country
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$ [OR] RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^HK$ [OR] RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MO$ [OR] RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MY$ [OR] RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^SG$ [OR] RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^TW$ RewriteRule ^(.*)$ http://www.chinese.url [R,L] RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^JP$ RewriteRule ^(.*)$ http://www.japanese.url [R,L] RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^KP$ [OR] RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^KR$ RewriteRule ^(.*)$ http://www.korean.url [R,L] etc. and so forth |
Or, if you just want to redirect all non us / ca traffic to one general place:
RewriteEngine On RewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^US$ RewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^CA$ RewriteRule ^(.*)$ http://www.somethingthatmightconvert.com [R,L] |
Forgive me if this sounds stupid but wouldn't it be better to check the country/ip BEFORE the person joins to PREVENT them from joining?
If you're talking .htaccess then doesn't that imply that it's a protected directory i.e., one in which you would have already had to pay for to gain access. Why would you want to redirect them at that point? I'm confused... :Oh crap |
|
Quote:
|
Quote:
hmm, thanks :) |
All times are GMT -7. The time now is 12:54 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123