Config.php
Instead of changing your codebase manually when moving from staging to production, you can read configuration data directly from the system environment using a .env file and the vlucas/phpdotenv Composer Package.
While blocking access via .htaccess is helpful, it only works on Apache servers. If your server switches to Nginx or experiences a PHP crash, Apache rules are irrelevant. Moving the file physically outside the root is a far more robust solution. config.php
// 3. Application Paths (Absolute paths are safer) define('ROOT_DIR', dirname()); // Go up one level from config folder define('APP_DIR', ROOT_DIR . '/app'); define('PUBLIC_DIR', ROOT_DIR . '/public'); Instead of changing your codebase manually when moving