I’m working on an multi-national site for which the sponsors want pages supported so that each page:
Can be served from a single default page regardless of the country (80% of pages), and
Default pages can be ‘overridden’ by optionally including a country specific page. (NOT redirected.)
In-country people will maintain the country-custom 20% of pages, and a central person will maintain the other 80%.
I’m thinking of doing the following:
Have a generic page which is automatically used if the country specific page does not exist: site.com/default/slug-name/
Use the country specific page instead if it does exist. (i.e. New Zealand:
So going to the follow pages …
site.com/us/slug-name/ => returns content of:
site.com/nz/slug-name/ => returns content of:
site.com/br/slug-name/ => returns content of:
… etc …
And going to: site.com/slug-name/ will cause an IP location Lookup and will use the best guess of the country then will return the content for the appropriate country page.
So 2 questions:
1) Where (what WP hook) should I use to get the incoming request url and set/update the actual page reference whose content I want to return?
Get the incoming URL, check for matching slug.
If has exact match slug, then process that page. (continue default processing).
If no country matching slug exists, then update the “page to process” to the /default/slug-name page.
2) Are there any Plug-ins that have done this for me already?
Thanks in advance!
Read more here:: Country specific pages in a site