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.

One EE installation for 3 different sites: how do I redirect properly?

August 27, 2009 3:33pm

Subscribe [3]
  • #1 / Aug 27, 2009 3:33pm

    All4Design

    7 posts

    I have one EE installation which contains three sites for my client (let’s call them departments A, B and C). EE is installed on the main domain which hosts department A. The pages for departments B and C are all located in 2 different templategroups. The url-structure is as follows:
    - department A: http://www.department-a.com
    - department B: http://www.department-a.com/dept-b
    - department C: http://www.department-a.com/dept-c

    I am looking for a redirect script for my .htaccess file which rewrites the urls as follows:
    - department A: http://www.department-a.com (no change needed)
    - department B: http://www.department-b.com
    - department C: http://www.department-c.com

    Any help is welcome!

  • #2 / Aug 27, 2009 3:38pm

    Ingmar

    29245 posts

    The supported way, as it were, would be to use the Multi Site Manager. Otherwise, you could probably do it with the use of some mod_rewrite in .htaccess.

  • #3 / Aug 28, 2009 2:42am

    All4Design

    7 posts

    Can anyone advise how to use mod_rewrite in .htaccess to achieve this?

  • #4 / Aug 28, 2009 6:40pm

    grrramps

    2219 posts

    Can anyone advise how to use mod_rewrite in .htaccess to achieve this?

    Depending on your server setup, .htaccess may not be necessary. If all sites are on the same server at the same root level, it’s easy using path.php and it’s mostly self explanatory.

    Install EE in a directory as per normal and point one domain to that install. Set up other directories on the same level (not required, but easier), and copy the EE index.php and path.php files to each directory. Point the domains to the respective directories. Then, edit the path.php file in each directory to point to EE’s system files and the respective weblog for each.

    $system_path = "../mysitesystem/";
    $template_group = "mysite";
    $template = "index";
    $site_url = "http://mysite.com/";
    $site_index = "index.php";
    $site_404 = "";

    In other words, it’s doable. However, MSM makes management remarkably easier as you grow the number of sites and domains. Highly recommended.

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

ExpressionEngine News!

#eecms, #events, #releases