0

I am running a multisite network with around 8 websites. Currently, some sites have more content than others(for example, mysite.com/uk and mysite.com/dk have more posts). What I am trying to achieve is to create a redirect functionality for my network.

Expected user experience: visitor lands on one of the pages, we check his GEOIP location and if he is not from UK we display a notice if he wants to navigate to the native version of the current page he is on(if it exists). Example--- visitor lands on mysite.com/uk/pricing, but he is from Denmark ---> display the link to navigate to mysite.com/dk/priser.

I've already implemented the first part where we check his geoip location and then redirect the visitor to the base url of the website. Taking the previous example, I've done the first part where I redirect from mysite.com/uk/[any_url] to mysite.com/dk.

However, now I am stuck. I don't really know how wordpress works as I started learning php&wordpress 1 week ago. How should I check if the current page url has an equivalent on other sites?

Edit: I am not looking for a full solution, but rather steps into the right direction.

1 Answer 1

0

How should I check if the current page url has an equivalent on other sites?

WordPress itself has no knowledge of any equivalency between mysite.com/uk/pricing and mysite.com/dk/priser.

If you're using a multilingual site plugin to build the different language sites, that would be the plugin's job. But such a multilingual site plugin may very well have the feature you're trying to build already.

If you're not using any multilanguage site plugin, you'll need to develop a scheme to establish the equivalency between the pages yourself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.