Forum Moderators: phranque

Message Too Old, No Replies

Determine country from http header

mod_rewrite determine country

         

donovana

11:08 am on Jul 19, 2005 (gmt 0)

10+ Year Member



Using mod_rewrite, i want to rewrite the url depending on the country (not language) from the http header.

ie.
if http header country = US, /foo/us

I can't work out how to get the country. I'm currently doing it in java using request.getLocale().getCountry()so it must be possible.

Anyone know how?

ChadSEO

9:11 pm on Jul 19, 2005 (gmt 0)

10+ Year Member



Unfortunately, there is no http header that specifies country (though it certainly would make things easier). I imagine your Java code of getLocate().getCountr() is using the Accept-Language header to determine this information. You can see a list of HTTP headers at:

[w3.org ]