» Country Redirect

Google does it. Now you can too.

Easily redirect visitors on your website based on their location. This is ideal for multi-lingual websites or websites that target different regions around the world. For example, a visitor from Europe would be redirected to a product page with pricing in Euros, and a visitor from Japan is redirected to a page with pricing in Yen.

You can add as many country/region redirects in the same block as you wish. And to save time, there's a 'wildcard' fallback option to redirect everyone else who doesn't meet your country/region selection. If none of the selection criteria are activated, the page will simply view the page as usual.

In conjunction with redirecting based on the visitor's country/region, you can also use their user status - either all users, logged in, not logged in, super admin or not super admin. That's powerful!

Of course you can redirect to both internal pages (on the same website) or external pages (on 3rd party websites).

If you lock yourself out of the page by redirecting yourself, don't worry. A custom page attribute is included so you can easily disable the redirection on a particular page.

Overall, this is an essential package for any serious Concrete5 website owner.

Download from the Concrete5 Marketplace ($15)

Features:

  • Redirect by country or region/continent
  • Add multiple selection criteria - there's no limit!
  • Also filter criteria by user status (eg. 'logged in users from USA')
  • Redirect to internal or external pages
  • Includes custom page attribute to temporarily disable redirection on a specific page in case you are affected by the redirection and need to edit the page.
  • So easy to use!

Tips:

You only need to add this block to a page once - within the same block you can choose multiple redirection criteria. This is the perfect add-on if you have an international audience for your website and want to offer content tailored to suit specific countries or regions/continents.

IMPORTANT: If anything prevents the preferred PHP-based redirection method, the fallback Javascript-based redirection is used. When working as designed, the page will redirect BEFORE the page starts rendering using the preferred PHP-based redirection, otherwise with Javascript-based redirection, it occurs AFTER the page has loaded. In this situation the primary causes of interferrence are other event-driven add-ons or the C5 caching system. It's recommended that if you're running C5.4.2 or newer, then you turn off the cache for the page you're trying to redirect.

 

Advanced Tips:

While popular regions have been included (eg. North America, Europe, Asia, Australasia, etc), with a little PHP knowhow you can also create your own custom regions, or even edit the existing regions. All the countries are stored in an array, so a power user with basic PHP experience will find it easy to edit with Notepad.

If you want to see what countries are grouped into regions, here's a copy. Each country is represented with a 2 letter code. If you spot an error, please let me know via PM on concrete5.org.

BALKANS = "AL", "BA","HR", "RS", "ME", "BG", "MK", "GR"

EUROPE = "AL", "AD", "AM", "AT", "AZ", "BY", "BE", "BA", "BG", "HR", "CY", "CZ", "CS", "DK", "EE", "FI", "FR", "FX", "GB", "GE", "DE", "GR", "HU", "IS", "IE", "IT", "KZ", "LV", "LI", "LT", "LU", "MK", "MT", "MD", "MC", "ME", "NL", "NO", "PL", "PT", "RO", "RU", "SM", "RS", "SI", "ES", "SE", "CH", "TR", "UA", "UK", "VA"

MIDDLEEAST = "TR", "BH", "KW", "OM", "QA", "SA", "AE", "YE", "PS", "IQ", "IL. JO", "LB", "SY", "IR", "CY", "EG"

ASIA = "AF", "AM", "AZ", "BH", "BD", "BT", "IO", "DN", "KH", "CN", "CX", "CC", "GE", "HK", "IN", "ID", "IR", "IQ", "IL", "JP", "JO", "KZ", "KP", "KR", "KW", "KG", "LA", "LB", "MO", "MY", "MV", "MN", "NP", "OM", "PK", "PS", "PH", "QA", "RU", "SA", "SG", "LK", "SY", "TW", "TJ", "TH", "TP", "AE", "UZ", "VN", "YE"

NORTHAMERICA = "US", "CA"

SOUTHAMERICA = "AR", "BO", "BR", "CL", "CO", "EC", "FK", "GF", "GY", "PY", "PE", "SR", "UY", "VE"

CENTRALAMERICA = "BZ", "CR", "SV", "GT", "HN", "NI", "PA", "MX", "HT", "CU"

CARIBBEAN = "AI", "AG", "AW", "BS", "BB", "VG", "KY", "CU", "DM", "DO", "GD", "GP", "HT", "JM", "MQ", "MS", "AN", "PR", "KN", "LC", "VC", "TT", "TC", "VI"

AUSTRALASIA = "AU", "CX", "CC", "FJ", "NF", "NZ", "PG", "VU", "NC", "PF", "FM", "SB"

AFRICA = "AO", "BW", "CF", "CG", "CI", "CM", "DZ", "EG", "EH", "ET", "GA", "GH", "GQ", "KE", "LS", "LY", "MA", "MG", "ML", "MU", "MW", "MZ", "NE", "NG", "RW", "SD", "SO", "SR", "TD", "TO", "ZA", "ZM", "ZW"

Examples:

Click this link to try it out.

If you are located in North America, you'll be redirected to concrete5.org.

If you are located in Europe, you'll be redirected to c5extras.com.

All other visitors will be redirected to the c5extras Twitter page.

Demonstration Video:

Screenshots