Guides & TutorialsTroubleshootingCommon ErrorsTroubleshooting a 404 Page Not Found Error

Troubleshooting a 404 Page Not Found Error

Symptoms

When navigating to various sections of the Admin Area and Client Area, you may see an error that is similar to this example:

404 Not Found error page

The example's URL generates an SEO-friendly link instead of a link using variables (for example, index.php?rp=/admin/setup). Unfortunately, this is not rendering the page properly.

A 404 Page Not Found error message in the Admin Area may be due to an outdated .htaccess file.

Resolution

There are several ways to resolve this issue, depending on the situation.

Updating the .htaccess file

Updating the .htaccess file is the usual method of resolution. Only Apache-based web servers support this file. If you are using Nginx, this method will not work. WHMCS is ONLY tested on Apache.

First, go to the Admin Area Dashboard. From there, go to Configuration > System Settings > General Settings.

Navigate to Configuration > System Settings

If the 404 error prevents you from accessing Configuration > System Settings, type the filename into your browser's URL bar: configgeneral.php

Scroll to the bottom of the page to the Friendly URLs section. 

You may see that this setting is being manually overridden. By default, WHMCS will detect and pick the best option for your server environment.

If it has been manually overridden, there may be a problem in your configuration. To work with this, click Advanced Settings to the right of the Friendly URLs menu.

A new window will display important URI-related information. In the example below, Full Friendly Rewrite did not pass the environment mode tests. 

To attempt to correct this, click the Rewrite File tab.

This tab displays that the .htaccess rules are out-of-date. 

We recommend that you enable Auto-Managed Rewrite to prevent this in the future. Then, click Synchronize to close the window.

Click the Refresh icon for Friendly URLs to refresh the menu. If the issue is resolved, Full Friendly Rewrite will display in the menu and the sections that displayed the 404 error will be accessible again.

Reverting Friendly URL Mode to Basic

WHMCS attempts to automatically detect the correct Friendly URLs mode. However, some server settings may prevent WHMCS from detecting the friendly modes available. 

In this case, the easiest way to resolve this issue is changing your Friendly URLs setting to Basic URLs. This ensures that the links are set to the traditional URL that does not require mod_rewrite or any other server-side rules to render.

Admin Area

To do this, go to Configuration > System Settings > General Settings.

Navigate to Configuration > System Settings

If the 404 error prevents you accessing Configuration > System Settings, type the filename into your browser's URL bar: configgeneral.php

Scroll to the bottom of the page to the Friendly URLs section. Choose Basic URLs and click Save Changes.

When you do this, all of the previously-friendly-styled URLs will revert to a basic format and the issue will resolve.

SQL Query

If the WHMCS Admin Area is inaccessible, the Friendly URL setting can be modified directly in the MySQL® database with the following query:

 

UPDATE `tblconfiguration` SET `value` = 'basic' WHERE `setting` = 'RouteUriPathMode';
Click to copy

Make certain to back up your database before running this query.

When you do this, all of the previously-friendly-styled URLs will revert to a basic format and the issue will resolve.