Creating IP-to-location-based redirects using If-So is extremely simple. So simple that you can have your first geolocation redirect up and running in 3 minutes from now.
Step by step: How to create a geolocation redirect
- Download If-So from the WordPress directory (free).
- On your WordPress dashboard, under If-So, click “Add new trigger”.
- In Version A, select the Geolocation condition and set the locations for the redirect.
- Paste the shortcode below in the content field of version A.
[ifso-redirect url='https://example.com' type='js']
* Read below if you prefer to create a 301 or 302 redirect
- Replace http://www.example.com with the URL of the page to which you want to redirect.
- Hit “Publish”
- Paste the trigger shortcode as high as possible on the page you want to redirect.
The result – Users from the locations you have set in version A will be redirected to the page you have set in step 4.
Why If-So? A premium IP-to-location database. It’s all about accuracy…
The first and most important factor to consider when setting up IP-to-location-based content is the accuracy of the database.
No IP-to-location service is 100% accurate. The accuracy depends on many factors, but one thing is sure, you don’t want to take chances with free databases that are, naturally, much less accurate.
With If-So, you get 250 monthly premium geolocation sessions for free. No signup nor credit card is required. Simply download the plugin and create your first geolocation redirect.
The session amount can be upgraded anytime; read below for more information.
More reasons to use If-So to create Geolocation redirects
- No setup – No sign-up, no coding required.
- Built-in stats – See how many times each version was displayed and how many conversions occurred as a result.
- Block bots – Bots visiting your site might exhaust your session quota. If-So offers an option to log geolocation requests, find the bots, and block them from using sessions.
- Location-based pop-ups – Show a pop-up asking users if they want to be redirected.
- Cost-effective session count – If-So stores the IP as a session during the user’s visit. When visitors keep browsing the site, it only counts as one session.
- Page caching compatibility – Create location-based redirects without giving up on the advantages of cache.
PHP redirects (301/302 redirects)
If you prefer to create 301 or 302 redirects instead of a JS redirect, you can use the shortcodes below instead of the one suggested in the step-by-step guide.
301 (permanent) redirect:
[ifso-redirect url='https://example.com' code='301']
302 (temporary) redirect:
[ifso-redirect url='https://example.com' code='302']
301 and 302 redirects do not work with Ajax loading. If you paste the redirection shortcode inside an If-So trigger, make sure to add the parameter ajax=”no” to its shortcode (or use JS redirect instead).
More than just geolocation redirects
If-So offers many other personalization options and geolocation-based options.
Automatically display the user’s country name using a simple shortcode.
Show geotargeted pop-ups on page load or exit intent.
Create country-specific promotions, suggest a translated version of the page, and more.
Show the user’s country flag
Paste a simple shortcode to display an image or emoji of the user’s country flag.
Allow users to override the location as detected by our IP-to-location database.
Auto-Local time display
Show an event time calculated according to the visitor’s time zone.
Extra sessions – a Pro If-So license is not required – Affordable prices starting at $5 per month.
Free version: 250 monthly sessions (same premium IP-to-location database we use for our pro plans).
Extra sessions: A Pro If-So license is not required if you only want to use the geolocation condition. Simply subscribe to one of our affordable geolocation plans, activate the geolocation license on your site, and the amount of the session will be automatically updated.
Geolocation plans start from $5 per month for 10,000 monthly sessions and can be upgraded as needed.
Create your first geolocation redirect
Download If-So from the WordPress repository for free and have your first location-based ready in minutes.