This article may not be helpful to many of my readers, but I wanted to post it to help anyone else who ran into the same problem that I did in changing folders on a Joomla! website.
The procedure for changing directories / folders in Joomla! is fairly straight forward as long as you are keeping the Joomla! site on the same host server. In this case you don’t need to touch the database at all. Here’s the basic procedure to move from a sub-folder to the root:
- Check to make sure the root directory is empty. What I do is move any files into a sub-directory named “oldroot”. Obviously you don’t want to remove any directories that contain your needed website data. For example, if you have your website in the /joomla directory, you leave that directory in the root, but move all other files into the “oldroot” directory.
- Now that you have an empty pallet, COPY (don’t move) all the files and folders from the subdirectory (/joomla for example) to the root directory.
- Now that all the website files and folders are in the root directory, you need to change a few line items in the configuration.php file that now sits in your root directory. Edit the following lines:
Edit each of these lines to remove the sub-directory from the file path. In our example….
public $log_path = ‘/home/content/77/8427977/html/joomla/tmp’;
public $log_path = ‘/home/content/77/8427977/html/tmp’;
- Now browse to the root directory in your web-browser. The front page should come up. Try clicking on one of your menu items. If all your menu items work you are done. That’s all there is to it. If you get a 404 error on your menu links, you need to go on to the next step.
- Log in to the back-end of your Joomla! site (in the root directory). Go to Site / Global Configuration and click on the Site tab. Under SEO settings, check to see if the Yes radio button is checked next to “Search Engine Friendly URL’s”. If it is, you need to do one additional step. You can click the NO radio button and save the settings, but this will give you an ugly URL. You need to change the .htaccess file. Edit your htaccess file in your editor. Scroll down to the line that says RewriteBase in the example above it will show as RewriteBase /joomla/ . Now simply remove the joomla/ from the line so it reads RewriteBase /. Save the file and all should be well with your newly moved site.
I hope this article helps someone. I spent about 10 hours pulling my hair out over this one (and I was doing it in the wee hours of the morning so I wouldn’t lose business for my client).