![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
I am cool
Join Date: Jul 2003
Posts: 14,494
|
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! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Jan 2005
Posts: 105
|
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).
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
I am cool
Join Date: Jul 2003
Posts: 14,494
|
nonsense.. I have seen it posted before and you list all the country extensions that you want to have the script redirect
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Feb 2004
Location: Vancouver, Canada
Posts: 7,662
|
If it's that easy - I would like to know too!
__________________
ICQ: 2262.73945 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Registered User
Join Date: Feb 2005
Location: Minnesota
Posts: 19
|
You can redirect by language easily enough.
Check out http://www.htaccesstools.com/redirection-by-language/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Wisconsin
Posts: 4,517
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Wisconsin
Posts: 4,517
|
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] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Oct 2002
Location: Amsterdam, Netherlands
Posts: 202
|
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... ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
jellyfish
![]() ![]() Join Date: Dec 2003
Posts: 71,528
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Too lazy to set a custom title
Industry Role:
Join Date: Oct 2002
Location: The Boonies
Posts: 12,860
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Too lazy to set a custom title
Industry Role:
Join Date: Oct 2002
Location: The Boonies
Posts: 12,860
|
Quote:
hmm, thanks ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |