Difference between revisions of "Moving the site among directories/sub-directories"
From Joomla! Documentation
m (edited path for logs file) |
(Remove outdated and dangerous advice about declaring $live_site with a non-empty value. $ftp_root is unused in J! 4.x) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
<noinclude><languages /></noinclude> | <noinclude><languages /></noinclude> | ||
<translate><!--T:1--> | <translate><!--T:1--> | ||
− | Many times you install Joomla in a | + | Many times you install Joomla in a subdirectory and then want to move it to a higher level directory. Here's a short tutorial on how to do it.</translate> |
<translate><!--T:2--> | <translate><!--T:2--> | ||
− | Say you have installed Joomla in the | + | Say you have installed Joomla in the ''public_html/tryjoomla'' folder.</translate> |
<translate><!--T:3--> | <translate><!--T:3--> | ||
− | Now that you are satisfied with the site, you'll want to move to public_html.</translate> | + | Now that you are satisfied with the site, you'll want to move to ''public_html''.</translate> |
<translate><!--T:4--> | <translate><!--T:4--> | ||
− | 1. Move all the files from the | + | 1. Move all the files from the subdirectory (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 file manager that your hosting service provides.</translate> |
<translate><!--T:5--> | <translate><!--T:5--> | ||
− | 2. Download and open the configuration.php file in a text editor.</translate> | + | 2. Download and open the ''configuration.php'' file in a text editor.</translate> |
<translate><!--T:6--> | <translate><!--T:6--> | ||
− | 3. Simply remove the tryjoomla folder name from the path. Look for | + | 3. Simply remove the ''tryjoomla'' folder name from the path. Look for these lines:</translate> |
− | < | + | <syntaxhighlight lang="php"> |
− | |||
var $log_path = '/home/username/public_html/tryjoomla/administrator/logs'; | var $log_path = '/home/username/public_html/tryjoomla/administrator/logs'; | ||
var $tmp_path = '/home/username/public_html/tryjoomla/tmp'; | var $tmp_path = '/home/username/public_html/tryjoomla/tmp'; | ||
− | + | </syntaxhighlight> | |
− | </ | ||
<translate><!--T:7--> | <translate><!--T:7--> | ||
Change to:</translate> | Change to:</translate> | ||
− | < | + | <syntaxhighlight lang="php"> |
− | |||
var $log_path = '/home/username/public_html/administrator/logs'; | var $log_path = '/home/username/public_html/administrator/logs'; | ||
var $tmp_path = '/home/username/public_html/tmp'; | var $tmp_path = '/home/username/public_html/tmp'; | ||
− | + | </syntaxhighlight> | |
− | </ | ||
<translate><!--T:8--> | <translate><!--T:8--> | ||
− | N.B. | + | N.B. The ''$live_site'' variable should not be given a value. If it was given a value during installation, edit that path as well, for example:</translate> |
− | The $live_site variable | ||
− | < | + | <syntaxhighlight lang="php"> |
− | var $live_site = 'http://www.example.com | + | var $live_site = 'http://www.example.com'; |
− | </ | + | </syntaxhighlight> |
<translate><!--T:9--> | <translate><!--T:9--> | ||
Change to:</translate> | Change to:</translate> | ||
− | < | + | <syntaxhighlight lang="php"> |
− | var $live_site = ' | + | var $live_site = ''; |
− | </ | + | </syntaxhighlight> |
<translate><!--T:10--> | <translate><!--T:10--> | ||
− | 4. Check your site's .htaccess file. The subfolder should be removed | + | 4. Check your site's ''.htaccess'' file. The subfolder should be removed as well. The RewriteBase directive should be commented out. Check for a RewriteRule that contains the old subdirectory.</translate> |
<translate><!--T:11--> | <translate><!--T:11--> | ||
Line 54: | Line 49: | ||
<translate><!--T:12--> | <translate><!--T:12--> | ||
− | If you have cache enabled, login to the | + | If you have cache enabled, login to the Backend (which will now be at ''<nowiki>http://www.example.com/administrator</nowiki>'' and not ''<nowiki>http://www.example.com/tryjoomla/administrator</nowiki>''). Go to {{rarr|Tools,Clean Cache}} and delete all cache files.</translate> |
<noinclude> | <noinclude> |
Latest revision as of 07:46, 10 May 2023
Many times you install Joomla in a subdirectory 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 public_html/tryjoomla folder. Now that you are satisfied with the site, you'll want to move to public_html.
1. Move all the files from the subdirectory (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 file manager 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 these lines:
var $log_path = '/home/username/public_html/tryjoomla/administrator/logs';
var $tmp_path = '/home/username/public_html/tryjoomla/tmp';
Change to:
var $log_path = '/home/username/public_html/administrator/logs';
var $tmp_path = '/home/username/public_html/tmp';
N.B. The $live_site variable should not be given a value. If it was given a value during installation, edit that path as well, for example:
var $live_site = 'http://www.example.com';
Change to:
var $live_site = '';
4. Check your site's .htaccess file. The subfolder should be removed as well. The RewriteBase directive should be commented out. Check for a RewriteRule that contains the old subdirectory.
5. Verify that no redirect orders to the old subdirectory are in place in your hosting control panel.
If you have cache enabled, login to the Backend (which will now be at http://www.example.com/administrator and not http://www.example.com/tryjoomla/administrator). Go to Tools → Clean Cache and delete all cache files.