Location-based redirection

You will require this information when you would like to set up a redirect for users who try to visit a specific section of your Haiku website to take them to a different part of the website, or another site completely, configured by the location that the content is being accessed from.


The use of user location-based redirection should be thought about very carefully before it is implemented.

  • Location-based redirection can easily be confusing for a user. A user may try to access a URL that they really want to visit as they may have visited it before, but if there is a redirection rule in place, the user will never be able to access the page they are trying to get to.

  • Location-based redirection is not 100% accurate, and should never be considered to be. This is for many reasons such as a mobile phone that is accessing a website through a carrier from another country can appear to be accessed from its host country rather than the country the user is visiting, or a user accessing the internet whilst using a VPN.

  • It is poor usability for a user to try to access a page and be taken to another page (especially an external page), as there is no warning this is going to happen due to the redirect occurring before the user sees the original page or content that they are trying to access.

  • This functionality is not to be used if you have moved a page or section on your website. When moving items in your website, the system keeps a history of the URL’s and generates aliases so that users will always be taken to the location the content lives.

If you would like to use this functionality but have some questions about it, please do get in touch with the team through the helpdesk, who will be happy to advise you.

Step-by-step instructions to set up the location-based redirect.

  1. Navigate to the section that you would like to redirect users from a certain country or countries when they try to access it (you will need to be logged in and have the Site Administrator privileges).

  2. Using the dropdown menu from your account name, in the top right of the page, on the edit bar, select 'Manage features'

  3. On the manage behaviours screen, you will see a check box field

    1. ‘Redirection’ - to enable the redirection, check this box and click ‘Save’

  4. You then need to define the parameters of the redirection. To do this, click ‘Edit’ at the top of the page.

  5. There will be a new tab on the edit form of the section called ‘Redirection’

    1. Please add redirection rules which contain portal role(s), country or countries and redirection target URL e.g.,

      1. The first parameter is the Haiku portal role(s) for whom you would like the redirection to take place: Anonymous, Authenticated, Contributor, Designer, Editor, Layout Editor, Manager, Member, Owner, Reader, Reviewer, Site Administrator. It can be omitted but if you want to provide country you must prepend '|' sign to this rule.

      2. The second parameter is two-letter country code as described here ISO 3166-1 alpha-2

      3. The last parameter is redirection target either local path e.g., /about-us or external URL like https://google.com.

    2. An example of some redirects is shown below:

      Editor,Contributor|US|/about-us/us Editor,Contributor|CA|/about/for-canada Anonymous|GB|/https://www.google.com

      The redirect on line 1 will send users who have the role ‘Editor’ or ‘Contributor’ who are visiting the section the rule is set on from the United States directly to the page ‘/about-us/us’ which is a local page on the website.
      The redirect on line 3 will send users who have the role ‘Editor’ or ‘Contributor’ who are visiting the section the rule is set on from Canada directly to the page ‘/about/for-canada’ which is a local page on the website.
      The redirect on line 5 will send users whoa re anonymous and have no role on the website who are visiting the section the rule is set on from Great Britain to 'https://www.google.com which is an external website.

  6. You are able to add multiple redirection rules to on section, please add one rule per line in the field.

  7. Be sure to save the changes that you have made at the bottom of the page.