404 Page Not Found Errors

Problem

When navigating to various sections of the Admin Area and Client Area, you see the following error:

404 Not Found: The requested URL was not found on this server.

If this error appears while attempting to update WHMCS in the browser, you will need to perform a manual update. For steps, see [/system/updates/update-on-the-command-line].

Cause

In most cases, this error is due to one of the following causes:

  • The URL generates an SEO-friendly link instead of a link using variables (for example, index.php?rp=/admin/setup).
  • An outdated .htaccess file.

Solution

There are multiple ways to resolve this issue, depending on the cause:

Revert 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.

To do this:

  1. Go to Configuration () > System Settings > General Settings and choose the General tab.
    If the 404 error prevents you from accessing Configuration () > System Settings, type the filename into your browser’s URL bar: configgeneral.php
  2. In the Friendly URLs section, select Basic URLs.
  3. Click Save Changes.

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

If the WHMCS Admin Area is inaccessible, you can also modify the Friendly URL setting by running the following command against your MySQL® database:

UPDATE tblconfigurationSETvalue= 'basic' WHEREsetting = 'RouteUriPathMode';

Update the .htaccess File

To update the .htaccess file:

  1. Go to the General tab at Configuration () > System Settings > General Settings.
    If the 404 error prevents you from accessing Configuration () > System Settings, type the filename into your browser’s URL bar: configgeneral.php
  2. Scroll 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.
  3. Click Advanced Settings to the right of the Friendly URLs menu. A new window will display important URI-related information. You may see an indication that Full Friendly Rewrite did not pass the environment mode tests:
    An environment mode test failure.
  4. Click the Rewrite File tab. If you see an OUT OF SYNC message under WHMCS Rules, the .htaccess rules are out-of-date:
    Out-of-date WHMCS rules.
  5. Enable Auto-Managed Rewrite to ensure that the rules stay up-to-date in the future.
  6. Click Synchronize to close the window.
  7. 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.
    The Friendly URLs setting.

Last modified: June 14, 2024