elxis sites
be more productive
Elxis allows you to be more productive. The creation of a complex web site was never so easy.
download elxis
elxis 2009.2 electra - 10.41mb
Home arrow Guides arrow General guides arrow Move Elxis from a sub-directory to the root folder
english greek

Move Elxis from a sub-directory to the root folder

Tuesday, 29 April 2008

Sometimes, especially when we want to test Elxis or to create our site in private while an old site is running we install Elxis in a sub-directory. In this guide we will show you how you can move your Elxis site to an other folder (to the www root folder in this example) fast and easy. I will use SSH access to make this process fast as light. You can do the same using FTP if you don't have SSH access but will take you longer. If you wish to be sure that everything will go fine take a full site backup (both files and database) before you proceed further.

1. Move Elxis files

For this example sake we consider our enviroment as follows. I write example paths for CPanel (running on Red Hat). Change the paths if needed to suit your server enviroment.

WWW root folder: /home/user/public_html
Elxis installation folder: /home/user/public_html/elxis

With the current set up Elxis is accessed from a browser like this:
http://www.mydomain.com/elxis/

We want to move Elxis to the WWW root folder in order to be accessible like this:
http://www.mydomain.com/

Login to your server using SSH and go to the WWW root folder.
cd /home/user/public_html

Make sure there are no folders or files there that have the same names as Elxis! cd to the Elxis installation folder:
cd elxis

Move everything a folder up:
mv * ../

* If you dont have SSH access you will have to do this via FTP.

Sometimes a file (i.e. an .htaccess file) stays in the old directory. Make sure everything was moved a folder up and the elxis/ directory is empty. If not, move the remaining files manually.

ls -la
mv .htaccess ../.htaccess


Go to the WWW root folder and remove the empty elxis/ folder:
cd ../
rmdir elxis

2. Update configuration.php file

Download configuration.php and edit it with PsPad or another UTF-8 enabled text editor. Remove the old sub-directory (elxis) from the paths and the URLs .

<?php
//From this:
$mosConfig_absolute_path = '/home/user/public_html/elxis';
$mosConfig_live_site = 'http://www.mydomain.com/elxis';
$mosConfig_cachepath = '/home/user/public_html/elxis/cache';

//Change to this:
$mosConfig_absolute_path = '/home/user/public_html';
$mosConfig_live_site = 'http://www.mydomain.com';
$mosConfig_cachepath = '/home/user/public_html/cache';
?>

Save and upload back to your server the configuration.php overwritting the old one.

3. Update database

There will be surely images and links in your database written based on the old URL (the one with the "elxis" sub-directory). We need to update them otherwise you will have 404 errors (page not found). Login to your database manager (i.e. phpMyAdmin) and take a full database backup. Open the SQL backup file with PsPad. Select from the menu Search -> Search and replace.

Replace all URLs from this:
http://www.mydomain.com/elxis
To this:
http://www.mydomain.com
Save the SQL file and import it in your online database (you will have to drop all existing db tables before).

4. Update .htaccess file

If you had SEO PRO enabled in the old Elxis site (the one in the sub-directory) you have to update the .htaccess file. In this case edit .htaccess file and change:
RewriteBase /elxis/
To this:
RewriteBase /

That's it! Everything should work fine now and your Elxis site will be accessible from the WWW root directory!

 

Finish

Login to Elxis administration and go to component SoftDisk. Click once on the Update System icon to update SoftDisk (system paths and URLs). Go to Elxis tools and run the Clean Cache tool to make sure there are no old cached files. Job done, congratulations!

< Previous Next >