Automatically redirect users from any page on your site to an equivalent page on a parallel website!
Commonly used for: Redirecting every page on a .com website to an equivalent page on a co.uk website.
On this page
The ‘Geolocation Redirect Template’ option enables you to effortlessly redirect visitors to parallel pages on another website using a single, straightforward shortcode.
The redirection URL is automatically generated for each page using one single shortcode.
All the features available in our standard redirection shortcode, including the ability to redirect users only once and choose the redirection type (301/302/JavaScript), are also applicable with the Geolocation Redirect Template.
The shortcode is structured in a way that allows you complete flexibility to construct any URL template you want.
The most common use cases, however, are:
.com → .co.uk
.com/… → .com/uk/…
Easily…
[ifso-redirect url='{{SCHEME}}://{{DOMAIN}}.{{TLD}}{{PATH}}']
The parameters will grab their value automatically from the page the shortcode is applying to. If you want to redirect users from a .com site to a parallel page on a .co.uk site, for example, all you need to do is replace the {{TLD}} parameter with the value co.uk, and keep the rest of the parameters as is.
For example:
[ifso-redirect url='{{SCHEME}}://{{DOMAIN}}.co.uk{{PATH}}']
The table below lists the available parameters and their values:
Parameter | Example |
{{SCHEME}} | https |
{{HOST}} | if-so.com |
{{PATH}} | /subdir/something/index.php |
{{QUERY}} | hello=world |
{{DOMAIN}} | if-so |
{{TLD}} | com |
Applying the shortcode on multiple pages is possible in two ways:
To include the shortcode on all your product pages at once using PHP, simply use the following code:
<?php echo do_shortcode("[ifso-redirect url='{{SCHEME}}://{{DOMAIN}}.co.uk{{PATH}}']"); ?>