We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Changing site URL - how easy/hard

How Do I?

tompuukko's avatar
tompuukko
1 posts
10 years ago
tompuukko's avatar tompuukko

Hi all,

I run an e-commerce business built on expression engine & expresso store. We have a live site, but now need to completely change our URL. Can anyone give me any guidance on how easy/difficult this is + how to approach it? I’d like to have this knowledge for discussions with our development team.

Thanks for your help!

Tom

       
airways's avatar
airways
154 posts
10 years ago
airways's avatar airways

First tip for approaching this is to make sure you do this on a test domain / server first to avoid any downtime.

Other than that, there are a handful of things you may want to override in your config.php file to make things easier:

  • Override the site_url and site_path values:
$config['site_url'] = 'http://example.com/';
$config['site_path'] = '/home/user/example.com/';

// Base urls
$config['cp_url'] = $config['site_url'] . "manage.php";
$config['base_url'] = $config['site_url'];

// Additional paths
$config['uploads_url'] = $config['staging_url'].'uploads/';
$config['assets_url'] = $config['site_url'].'assets/';

// System Prefs 
$config['member_theme'] = 'default';
$config['cp_theme'] = 'nerdery';
$config['third_party_path']  = $config['site_path'] . 'third_party/';
$config['theme_folder_path']  = $config['site_path'] . 'themes/';
$config['theme_folder_url'] = $config['site_url'] .'themes/';
$config['captcha_path'] = $config['site_path'] . 'images/captchas/';
$config['captcha_url']  = $config['site_url'] . 'images/captchas/';


// File and upload related prefs
$config['emoticon_path'] = $config['site_url'] . 'images/smileys/';
$config['avatar_path'] = $config['site_path'] . 'images/avatars/';
$config['avatar_url'] = $config['site_url'] . 'images/avatars/';
$config['photo_path'] = $config['site_path'] . 'images/member_photos/';
$config['photo_url'] = $config['site_url'] . 'images/member_photos/';
$config['sig_img_path'] = $config['site_path'] . 'images/signature_attachments/';
$config['sig_img_url'] = $config['site_url'] . 'images/signature_attachments/';
$config['prv_msg_upload_path'] = $config['site_path'] . 'images/pm_attachments/';
$config['prv_msg_upload_url'] = $config['site_url'] . 'images/pm_attachments/';
$config['board_upload_path'] = $config['site_path'] . 'images/forum_attachments/';
$config['board_upload_url'] = $config['site_url'] . 'images/forum_attachments/';
  • Override your upload preferences in config.php. Setup this array to match the values as stored in the database, with the paths overridden using the above values. Note that each directory still needs to exist in the database, as well as in this array, for the override to work. I add the * at the end of each directory “name” value so I know it is being overwritten by the config file and not loaded from the database (where the * is omitted from each name).
$config['upload_preferences'] = array(
    1 => array(
        'name'        => 'Image Uploads*',
        'server_path' => $config['site_path'].'uploads/images/',
        'url'         => $config['site_url'].'uploads/images/',
        'max_width'   => 2400,
        'max_height'  => 2400,
    ),
    2 => array(
        'name'        => 'Document Uploads*',
        'server_path' => $config['site_path'].'uploads/docs/',
        'url'         => $config['site_url'].'uploads/docs/'
    ),
  • Make sure to check in the documentation for each third-party add-on to see if they have any special requirements. This is very rare in my experience, but can be an issue with anything that deals with image files or uploads.

  • Make sure that the uri_protocol you are using is supported by the new host (assuming you are changing hosts as well as domains, which may not be the case). This can only be found out by testing.

I’m sure there are a lot of other things but these are the big ones I remember going wrong for me in the past. ExpressionEngine has gotten a lot better about not storing paths and domains in the database very much, and with the above overrides you should be able to eliminate the few that remain.

One last note, it may be worth it to sign up for at least a Silver support account when you do this transition as EllisLab will then help you get through it if something goes wrong.

       
tompuukko's avatar
tompuukko
1 posts
10 years ago
tompuukko's avatar tompuukko

thanks airways, really helpful. So from your perspective/experience it’s pretty straightforward (if you plan it as you’ve suggested)

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.