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.

Use a template group for a subdomain

August 12, 2010 6:27am

Subscribe [2]
  • #1 / Aug 12, 2010 6:27am

    bikuta

    118 posts

    Hi,

    I haven’t had much experience with EE, and so far I’ve been able to create template groups and access them by going to http://mysite.com/templategroupname.

    However is it possible for me to access them by going to:
    templategroupname.mysite.com?
    i.e., make them point to a subdomain

    What would I need to do?

    Cheers,
    Victor

  • #2 / Aug 12, 2010 9:52am

    James Smith

    259 posts

    Anything’s possible with enough effort…

    Easiest way to get this working would probably be:

    1. Enable “Wildcard DNS” in your server config (or get your host to do it for you). This will allow you to access anythingyoulike.domain.com without setting up separate virtual hosts.

    2. Set up a rewrite rule in htaccess which invisibly rewrites the request internally for the ‘correct’ path.

    My htaccess/regex voodoo is not good I’m afraid so can’t help you with the exact syntax, but it should work.

    One caveat, however… I seem to remember in the past some versions of IE have trouble rendering sites which include underscores in the sub-domain name (and I think it might be against the W3C HTTP spec) - so your template groups would have to avoid underscores.

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

ExpressionEngine News!

#eecms, #events, #releases