How do I move important Joomla files outside public_html?

Prohibiting direct web access to important Joomla! files by placing them outside your public_html directory is a good practice in terms of security.

For example, if you want to move the main configuration file (configuration.php) of your Joomla! outside the public_html directory, you can do that by following these instructions:

  • Move the configuration.php file to a safe directory outside of public_html and rename it however you want. For the purpose of this article we have chosen to name the file joomconf.original.php
  • Create a new configuration.php file in your public_html directory containing only the following code:

<?php
require( dirname( __FILE__ ) . '/../joomconf.original.php ' );
?>

Joomla is a powerful software that is easy to work with once you have the right host to support you. Before you lose any more time with the wrong host, check out the SiteGround Joomla hosting offer.