samoht Posted October 9, 2009 Share Posted October 9, 2009 Hello all, I have seen that Google analytics can tell you where a visitor is coming from and I want to do something similar. But I would like to add the functionality of redirecting a user based on his location Example: if a users location is from the "US" I would like to redirect all the links on the site to include /us/ after the domain. If the user comes from anywhere outside the US is would like the links to be normal. Any Ideas?? Thanks, Quote Link to comment Share on other sites More sharing options...
lemmin Posted October 9, 2009 Share Posted October 9, 2009 You will have to use an IP location table. I think you can get these for free from somewhere, but some make you pay. Just do a google search for it and you will find more information. Quote Link to comment Share on other sites More sharing options...
samoht Posted October 9, 2009 Author Share Posted October 9, 2009 OK I have the IP location table and the ability to retrieve the IP's location. However, I just put the include file into my index.php - How do I change the url from there? Quote Link to comment Share on other sites More sharing options...
lemmin Posted October 12, 2009 Share Posted October 12, 2009 Change what URL? Are you talking about redirecting? You can set the header to a different location: header("Location: file.php"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.