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 help with .htaccess (Filtering foreign countries) (https://gfy.com/showthread.php?t=449565)

KMR Stitch 03-29-2005 01:13 AM

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!

darnoth 03-29-2005 01:24 AM

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).

KMR Stitch 03-29-2005 01:32 AM

nonsense.. I have seen it posted before and you list all the country extensions that you want to have the script redirect

Steen2 03-29-2005 01:37 AM

If it's that easy - I would like to know too!

PolySix 03-29-2005 02:59 AM

You can redirect by language easily enough.

Check out http://www.htaccesstools.com/redirection-by-language/

Lycanthrope 03-29-2005 03:16 AM

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

Lycanthrope 03-29-2005 03:22 AM

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]

Verotel 03-29-2005 04:07 AM

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

Manowar 03-29-2005 04:09 AM

http://www.businessvoyeur.com/2005-0...nking-in-depth

Thanks to fusion x

iwantchixx 03-29-2005 09:36 AM

Quote:

Originally Posted by Verotel
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

This is for filtering out unuseful traffic. He asked this for me. I don't get paid for it. So I might as well filter it out and send it elsewheres.

iwantchixx 03-29-2005 09:38 AM

Quote:

Originally Posted by Lycanthrope
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


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