Login

Source: 

Many times you install Joomla in a sub-directory and then want to move it to a higher level directory, here's a short tutorial on how to do it.

Say you have installed Joomla in the following folder: public_html/tryjoomla. Now that you are satisfied with the site, you'll want to move to public_html.

1. Move all the files from the sub-directory (i.e., public_html/tryjoomla) to the upper level directory (i.e., public_html). You can use your favourite FTP client or the control panel that your hosting service provides.

2. Download and open the configuration.php file in a text editor.

3. Simply remove the tryjoomla folder name from the path. Look for the following lines

var $live_site = '';
var $log_path = '/home/username/public_html/tryjoomla/logs';
var $tmp_path = '/home/username/public_html/tryjoomla/tmp';
var $ftp_root = 'public_html/tryjoomla';

Change to:

var $live_site = '';
var $log_path = '/home/username/public_html/logs';
var $tmp_path = '/home/username/public_html/tmp';
var $ftp_root = 'public_html';


N.B. The $live_site variable rarely needs to be given a value. But if it was given a value during installation then edit that path as well.

var $live_site = 'http://www.example.com/tryjoomla';

Change to:

var $live_site = 'http://www.example.com';

 


4. Check your .htaccess. The subfolder should be removed there as well.

If you have cache enabled, login to the administrator backend (which will now be at http://www.example.com/administrator and nothttp://www.example.com/tryjoomla/administrator). Go to Tools -> Clean Cache and delete all cache files.

Source: 

I haven't tested it yet (as you can see) but it's the only solution I found that doesn't include installation of an extra Component:

  1. Connect with your favorite FTP program to your Server, find “components/com_content/router.php“, download and make a backup of the file ... then edit it.

  2. Find and Replace:
    $advanced = $params->get('sef_advanced_link', 0);
    With this:
    $advanced = $params->get('sef_advanced_link', 1);

    There are two places need to do this change, one near the top, one in the middle

  3. You want to edit your router.php file:
    - From: ->where($db->quoteName(‘alias’) . ‘ = ‘ . $db->quote($db->quote($segment)));
    - To: ->where($db->quoteName(‘alias’) . ‘ = ‘ . $db->quote($segment));

  4. Save, reupload the file and test it.

Update: Tested and working perfectly. Be sure to search for the line in step 3 thoroughly in case the copy paste doesn't work.

Go to top