Forum Moderators: phranque

Message Too Old, No Replies

Using mod_rewrite & RewriteMap with IP/country

Practicalities of using RewriteMap to redirect users based on location

         

krs3

6:10 pm on Apr 1, 2004 (gmt 0)



Appologies if this has been asked before I searched but didnt find anything covering this.

I need to deliver customised content based on the users location. I already have the [ip-to-country.webhosting.info...] database and have a working solution in php, however I want to switch over to a solution using mod_rewrite and cookies, my plan is that with mod_rewrite and .htaccess on the relevant folders;

check for location cookie >
if location cookie exists rewrite url based on cookie value
otherwise >
match user IP against table >
rewrite url based on ip/location

each time the user arrives at a customised page the location cookie is set using javascript.

my questions are, can I do this?
and if I can how practical is it? the IP-country database is obviously large and I'm worried that it might too much for RewriteMap although the alternative is using Php which would cause a higher load.