ExpressionEngine® User Guide

Legacy Documentation

You are using the documentation for version 4.3.8. Go here for the latest version.

Post-Installation Best Practices

ExpressionEngine’s first party files and directories in the system folder on a properly configured server are typically safe from direct HTTP access. However, for increased security in various environments, we recommend that the system folder either be renamed or moved entirely above the public site folder (commonly named public_html or referred to as simply “webroot”) and that admin.php be renamed as well.

Renaming the System Directory

This is an easily followed procedure that makes it difficult for the location of your system folder to be known.

  1. FTP to your server and change the name of the system folder to something else that is not easily guessed. For example, let’s say you’ve renamed it to dazzle.
  2. Open index.php and admin.php (both found in your site’s root) and update the name of the system directory in both files:
$system_path = './dazzle';

Note

There may also be some areas in the Control Panel where you will need to update the server path. For example:

  • Settings ‣ URL and Path Settings
  • Files

Moving the System Directory Above Webroot

This is a more advanced procedure that provides even better security, but is not supported in all environments.

  1. FTP to your server and move the entire system folder above webroot, but still within your user’s account folder.
  2. Open index.php and admin.php (both found in your site’s root) and update the relative path to the system directory in both files. Here’s an example:

Before

Your folder structure looked like…

.
└── public_html
    ├── admin.php
    ├── index.php
    ├── images
    ├── system
    └── themes

… with index.php and admin.php having:

$system_path = './system';

After

Now your your folder structure looks like…

.
├── public_html
|   ├── admin.php
|   ├── index.php
|   ├── images
│   └── themes
└── system

… so index.php and admin.php now have:

$system_path = '../system';

Note the extra period, indicating that the system folder is now one level up, above webroot where it cannot be directly accessed from a web browser.

Note

There may also be some areas in the Control Panel where you will need to update the server path. For example:

  • Settings ‣ URL and Path Settings
  • Files

Renaming admin.php

In the same way that we’ve renamed the system folder (or moved it above webroot entirely) it is recommended that you rename admin.php to something less obvious as well.

  1. FTP to your server and change the name of the admin.php file to something else that is not easily guessed. For example, let’s say you’ve renamed it to razzle.php.

  2. Visit Settings ‣ URL and Path Settings and update the Control Panel URL setting. Alternatively you can open system/user/config/config.php (or whatever you have renamed the system folder to) and update the URL using the cp_url override:

    $config['cp_url'] = "https://example.com/razzle.php";
    

Removing index.php from your URLs

ExpressionEngine is a PHP application, so it is invoked whenever the web server requests the index.php file, e.g.: https://example.com/some/url. You can configure your server to invoke this file without having it appear in the URL. See Removing index.php from URLs for details on how to accomplish this.