Implementing geotargeting while using a single database

I'm working on a Wordpress site with a large amount of users in multple countries (UK, US, and sever African countries - Nigeria, Kenya etc). All our content is in English and we don't have the ability yet to re-do content for other areas. We do however have some small bits of content we'd like to show in certain areas of our site (free bets and special offers) dependant on country.

We've tried using server side detection of the user's location and showing the relevant free bets and offers, however we have server side caching which creates a static version of each page of the site every 30 seconds (meaning a user from Kenya could visit the site, triggering the cache and subsequently showing all users Kenyan free bets and offers for the next 30 seconds until the cache is refreshed).

To get around this we are suggesting implementing a url structure as follows:

  • website.com (UK version)
  • website.com/us/ (US version)
  • website.com/ke/ (Kenyan version)
  • etc...

The question I have is, how would this be implemented in the context of Wordpress while using a singular database for each country's 'site'?

Thanks

Topic url-rewriting geo-data Wordpress

Category Web


You can use WPML for this, no need to use multiple databases. You can simply select which content to translate, and set your URL structure to

  • website.com (UK version)
  • website.com/us/ (US version)
  • website.com/ke/ (Kenyan version)
  • etc

as you pointed out above.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.