ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Run an old site design on a subdomain connected to same database as root site?

November 24, 2012 1:54pm

Subscribe [1]
  • #1 / Nov 24, 2012 1:54pm

    David Hyland's avatar

    David Hyland

    210 posts

    I recently completed a redesign/rebuild of a clients website (both using EE2) but now the client wants to run the old design on a subdomain alongside the new website for certain users for just a few months (v1.domain.com). The data will be the same just different templates and assets.

    Initially I thought no problem, I’ll just set up the subdomain, move the old files there and point it at the same database. But clearly it’s not as simple as that.

    I’ve managed to get the homepage on the subdomain to work correctly, pulling in the data from the main database however all internal pages throw a 404.

    So my question is this. How can I run two sites (root domain and subdomain) off the same database, both using different set of templates and assets but both using the same uploaded images and files? The old site does not technically have to be a subdomain, it could just be a folder off the root.

    I’ve considered pointing the subdomain at the server root and making config edits to check for which site is being requested but is it possible to have different template folders in this case?

    Nested template groups would work well for this I think as I could have a “v1” group containing all the old templates but I don’t think that’s possible, is it?

    So does anyone have any bright ideas about how to achieve this? As it’s only for a few months I don’t really want to purchase MSM unless it’s absolutely the only option.

    ==

    UPDATE

    I solved my own problem in the end by simply adding some http_host checks for the subdomain into the config file then using conditional embeds for the identical template groups between the two sites, adding the old template groups and moving the old assets into a new folder and changing all the old asset links.

    Job done 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases