Customising the Admin Directory
Customising the name of your WHMCS admin directory makes it harder for bots and other malicious users to find your admin login url.
Renaming Your Admin Directory
The WHMCS software requires to know the name of the admin directory in order to function, so if you wish to change it, follow the steps below:
- Open the configuration.php file within your WHMCS installation's root directory
- At the bottom of the file (before the closing PHP tag ?> if one exists), add the following line:
$customadminpath = "mycustomfoldername";
- Replacing mycustomfoldername with the name you wish to use for your admin directory. This should just be the directory name, not a full path.
- If your configuration.php file already contains a custom admin path definition, you can simply update the existing line
- Rename the admin directory to the name you specified in step 2 above
- You cannot move the admin directory outside of the WHMCS folder tree - you can rename it, but not move it
- The admin directory name may only contain standard a-z 0-9 latin characters as well as dashes(-), underscores(_) and dots(.)
Important Note for Upgrading
Remember! If you customise the name of your WHMCS admin directory, when it comes to applying updates or patches, it is important to remember to upload any files contained within the default "admin" directory in the distribution zip files to your custom admin directory folder. Failure to do this will result in unexpected behaviour.
Should WHMCS detect a conflict between your settings and the admin directory path you are trying to access, you will see one of the error messages below. Details of how to resolve each one are provided.
You are attempting to access the admin area via a directory that is not configured. Please either revert to the default admin directory name, or see our documentation for Customising the Admin Directory
Seeing this error message indicates that you have not yet added the $customadminpath line to your WHMCS configuration.php file, or it has been done incorrectly. Please follow the steps above again. If you continue to experience the error message even after that, revert your admin directory name to the default "admin" name to regain access and contact our support team for assistance.
You are attempting to access the admin area via a directory that is different from the one configured. Please refer to the Customising the Admin Directory documentation for instructions on how to update it.
Seeing this error message indicates that the directory name you are attempting to access your admin area via is different to the value specified in the $customadminpath variable inside of your WHMCS configuration.php file. Follow the steps above in order to update it.
You are attempting to access the admin area via a custom directory, but we have detected the presence of a default "admin" directory too. This could indicate files from a recent update have been uploaded to the default admin path location instead of the custom one, resulting in these files being out of date. Please ensure your custom admin folder contains all the latest files, and delete the default admin directory to continue.
Seeing this error message indicates that you have a custom admin directory path defined, and are attempting to access your WHMCS installation using it, but WHMCS has also detected the presence of a default "admin" directory too. Typically this indicates that an update has recently been applied and some of the files from that update have been uploaded to the default "admin" directory path. In doing this, it means the files you are using in your custom admin directory are not up-to-date which can lead to unexpected errors and consequences. Please ensure you have uploaded all of the latest files to your custom admin directory location and then delete the default "admin" directory.