A few months ago I created an extremely basic WordPress plugin that allows users to redirect users based on location. You can find the code to the plugin on Github here. Simply add the PHP file in the repository to the wp-content/plugins directory of your WordPress site and the plugin will automatically activate.
The example code of the plugin sets redirect rules for users in Brazil, United States and the rest of the world. In order to properly use the plugin, you must modify the code to the proper ISO 3166 country codes accepted by MaxMind’s GeoIP configuration WP Engine’s is based on. Additionally, the destination URLs for the redirects must also be set directly in the PHP file itself.
This is only a basic example plugin to easily set redirects. In order to correctly use this plugin you must have a Business Plan or higher at WP Engine and have the WP Engine GeoIP plugin enabled. The plugin can be used to redirect based on ISO 3166 Region (State) codes as well, but it would require changing HTTP_GEOIP_COUNTRY_CODE to HTTP_GEOIP_REGION.
Hi Jhon,
I just wanted to let you know that our plugins at https://geotargetingwp.com are 100% compatible with WpEngine (when geoip enabled). They are basically a bit more features rich version of WpEngine plugin.
Feel free to contact me if you want more information. Thanks!