Forum Moderators: phranque

Message Too Old, No Replies

Mod GeoIP For apache .htaccess help.

Mod_GeoIP For apache .htaccess help. redirect all but certain country code

         

RDLiNET

6:40 pm on May 9, 2008 (gmt 0)

10+ Year Member



Hello.

I am using the Mod_GeoIP mod for apache with the light version of the GeoIP.dat file.

I am hoping that someone might be able to provide me with an example .htaccess file that would redirect "ALL BUT US" Traffic. IE

Detect if the visitor is in fact coming from the US and "if not" redirect to a URL I define inside the .htaccess, if it is US then it displays the page normally.

This seems useful and I hoped to see it on the maxmind example page but did not, the only solution I could gather from the example page was to define a redirect for each and every non US country code which would make for a large .htaccess file.

Thanks very much!

jdMorgan

5:33 pm on May 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might want to look into the "NOT" Boolean logic operator, as used in mod_rewrite and scripting languages...

Jim