I am using Apache 2 and presently static HTML pages.
I would like my Euro-zone site visitors to determine a webpage which has the cost in pounds. My United kingdom site visitors should visit a page the cost in GBP. Everybody I wish to begin to see the cost in dollars.
I understand this can be an issue more suited to http://superuser.com/ - but I'm not sure if the option would be Apache 2 configuration or whether I have to use code.
Edit: I am prepared to try any client-side or server-side application. I don't have to convert the foreign currencies - it's a fixed euro cost, and glued GBP cost, along with a fixed dollar cost.
Have a look only at that:
or this:
I'd use mod_rewrite for your:
RewriteEngine On
RewriteCond %{HTTP_HOST} =www.example.com [NC]
RewriteCond %{REMOTE_ADDR} ^192\.168\.1\.[0-9]+$ [OR]
RewriteCond %{REMOTE_ADDR} ^192\.168\.3\.[0-9]+$
RewriteCond %{PATH_INFO} =/
RewriteRule ^(.*)$ http://www.example.com/abc_euro.htm$1 [R=301,L]
RewriteCond %{HTTP_HOST} =www.example.com [NC]
RewriteCond %{REMOTE_ADDR} ^192\.168\.2\.[0-9]+$ [OR]
RewriteCond %{REMOTE_ADDR} ^192\.168\.4\.[0-9]+$
RewriteCond %{PATH_INFO} =/
RewriteRule ^(.*)$ http://www.example.com/abc_uk.htm$1 [R=301,L]
(Presuming that 192.168.1.*
and 192.168.3.*
ip ranges come from eu, while 192.168.2.*
and 192.168.4.*
come from the United kingdom)
I am not so sure about use of RewriteCond %{PATH_INFO} =/
to point "request to root path" and therefore avoid infinite redirect-loops.. maybe it is possible better using LocationMatch
approximately..?
Using javascript something like:
- obtain the ip - http://www.hashemian.com/tools/visitor-IP.htm
- exercise where it's - http://www.hackingspirits.com/cyb_forensic/fsic_articles/loc_place.html
- convert the currency or show/hide as appropriate
p.s redShadow's response is better :-)