Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > Suggestions > Topic : GeoIP



Threaded Mode | Print  

 GeoIP, Include mod_geoip in PHP (0 Replies, Read 20989 times)
golabs
Group: Member
Post Group: Newbie
Posts: 5
Status:
I would like to see the GeoIP module included into AMPPS as it's great to work with for localization.

Of course - on a localhost you can only test it with some limitations but at least it enables you to test your code to see if it would work at all or not.

It would also allow me to keep my .htaccess the same for both my local dev environment and my online production environments.

The simplest usage for GeoIP is the following:

Code

# include ALL required code including stylesheets and base64 encoded images within bounce.php as external links are not allowed for the visitors who will see the bounce message
RewriteRule ^bounce/?$ /bounce.php [L,END]
# include the ISO3166 codes of the countries you want to *allow* access in the list
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^(US|CA)$
RewriteRule ^(.*)$ /bounce/ [L]


Which kinda acts as a 'firewall' to block off anyone not coming from either the United States or Canada.

IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is March 28, 2024, 5:47 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.026