Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9256017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:50:32+00:00 2026-06-18T11:50:32+00:00

I have an ExpressionEngine site set up with Git in multiple environments: Local, Development,

  • 0

I have an ExpressionEngine site set up with Git in multiple environments: Local, Development, and Production.

I have a couple of directories that are above web root, so the web root directory itself is inside the git repo, like this:

  • .git
  • system
  • third_party
  • templates
  • public_html (web root)
    • assets
      • css
      • js
      • img
    • themes
    • index.php

Now, my development and production environments are with 2 separate hosting providers, and their web roots have different names from each other. Development, for example, is named public_html, but Production is named content.

How do I deploy to both of these environments when the web root directories have different names?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:50:33+00:00Added an answer on June 18, 2026 at 11:50 am

    Using symbolic links on the server to point the web root to the appropriate directory is a time honored technique. Let’s assume you gave your Git Repo an obvious name: clientsite.com, so inside that folder you have:

    • .git
    • system
    • third_party
    • templates
    • web_root
      • assets
        • css
        • js
        • img
      • themes
      • index.php
      • admin.php

    That folder gets uploaded to your staging/production servers. On the staging server, you would then create a symbolic link to web_root named public_html:

    ln -s clientsite.com/web_root public_html

    And then on the production server, you would make a symbolic link to web_root called content:

    ln -s clientsite.com/web_root content


    Now, what’s brilliant about this is that if you are very clever and are using MSM, you can create config.php and index.php files that allow you to use web_root for ALL your domains in that EE installation and just create symbolic links to it for each site. For example:

    ln -s clientsite.com/web_root siteone_html
    
    ln -s clientsite.com/web_root sitetwo_html
    

    Then in index.php, you look at the HTTP_HOST server config to set the site_name:

    switch ( $_SERVER['HTTP_HOST'] ) {
    
        case 'siteone.com' :
        case 'dev.siteone.com' :
            $assign_to_config['site_name']  = 'siteone';
        break;
        case 'sitetwo.com' :
        case 'dev.sitetwo.com' :
            $assign_to_config['site_name']  = 'site two';
        break;
    }
    

    Finally, your config.php can do something very similar:

    $config['site_index']   = "";
    $config['site_url']     = "http://".$_SERVER['HTTP_HOST'];
    $config['server_path']  = $_SERVER['DOCUMENT_ROOT'];
    $config['cp_url']       = $config['site_url']."/".$config['system_folder'].'/index.php';
    
    ....stuff here...
    
    switch ( $_SERVER['HTTP_HOST'] ) {
    
        // production
        case 'siteone.com' :
            $config['cookie_domain'] = ".siteone.com";
            $db['expressionengine']['hostname'] = "111.222.111.22";
            $db['expressionengine']['username'] = "siteone";
            $db['expressionengine']['password'] = "passone";
            $db['expressionengine']['database'] = "database_live";
            $db['expressionengine']['db_debug'] = FALSE; 
        break;
    
        // staging
        case 'dev.siteone.com' :
            $config['cookie_domain'] = "dev.siteone.com";
            $db['expressionengine']['hostname'] = "333.444.555.22";
            $db['expressionengine']['username'] = "siteone";
            $db['expressionengine']['password'] = "passone";
            $db['expressionengine']['database'] = "database_dev";
            $db['expressionengine']['db_debug'] = FALSE; 
        break;
    }
    

    In this way, you can have global config options and then site specific options too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a site that uses ExpressionEngine as the CMS. We also use Magento's
My current site ( VisualHint ) uses ExpressionEngine and allows me to have the
In expression engine: I have a site that businesses can sign up and then
I have an ExpressionEngine template that is some global CSS styling. I have some
I am going to have an ExpressionEngine weblog that will place user designed content
I'm using expressionengine to create a documentation site, using the weblog module. I have
I have added a search functionality to my ExpressionEngine site, using the standard Search
i have to make some updates to a web site built using expression engine.
Have a chat room, issue is, is that when you submit something, the message
I'm using ExpressionEngine 2.5.2 with my Media Temple site. I recently added a second

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.