How do I move my site from a subfolder to the main domain?
Move all files up one level, then fix the folder paths in configuration.php and RewriteBase in .htaccess. Akeeba Backup can do this for you.
Why it needs a few edits
Joomla itself works out its address, but configuration.php and .htaccess may still contain the subfolder name, which breaks logs, temp files or clean URLs.
Steps
- Make a backup.
- Move all files from the subfolder (for example
public_html/new) up intopublic_html. - In
configuration.php, remove the subfolder fromlog_path,tmp_pathand, if set,live_site. - In
.htaccess, comment out or fix theRewriteBaseline and any rule that points to the old folder. - Check your hosting panel for redirects that still point to the subfolder.
- Log in at the new address and clear the cache (System → Clear Cache).
Good to know
- Set up a 301 redirect from the old subfolder addresses if the site was already public there.
Sources
- Moving Installation Directory – Joomla User Guide
- The htaccess.txt file – Joomla User Guide