Jump to:

23355 Posts in 17838 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Country-specific sub-directories - one instance of each page

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 270 Views
  • Rod
    Avatar
    Community Member
    12 Posts

    Country-specific sub-directories - one instance of each page Link to this post

    Hi there,

    Currently, we have a Silverstripe website which uses IP detection to serve different versions of the site to various countries. To achieve this I've created extra content fields in the CMS (e.g. Content - UK) and written conditions in the templates along the lines of:

    if user is from UK, and 'Content - UK' is not empty, show UK content, otherwise show default content.

    I've also set up checkboxes in the CMS like 'don't show in UK', 'don't show in AU' etc.
    The different localised versions of each page each have the same URL. The exception to this is in the UK, where we have a .co.uk domain which uses content replicated from the .com version.

    We need to change this for a couple of reasons - SEO requirements and the reliability of our site replication process.

    So, here's what I'd like to achieve:

    • - One instance of the cms (essentially like we already have, seeing as we don't touch the replicated UK copy).
    • - One domain with several country-specific sub-directories. These need to be: example.com/nz, example.com/uk, example.com/us, example.com/au and (ideally) a fallback if the visitor's IP isn't from one of these countries, which could be example.com/en.
    • - One instance of each page. 90% of the pages will be the same for all countries - there'll just be a handful which will either be only applicable to one or two countries, or will exist at all countries but will have slightly different content in each.

    EDIT: I originally asked about 'sub-domains', but of course I actually meant sub-directories, as per the url examples.

    Has anyone done anything like this before with Silverstripe? Can anyone point me in the right direction as to what to do or where to start!?

    Many thanks
    Liam

    270 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.