Friendly URLs

From WHMCS Documentation

Revision as of 17:19, 25 January 2023 by SarahK (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

We added this feature in WHMCS 7.2.

Many parts of WHMCS can be accessed through search-engine-friendly URLs. The way in which WHMCS processes these depends on your server environment.

What is a Friendly URL?

By default, URLs in WHMCS use the following format:

/knowledgebase.php?action=view&id=1

However, when you enable Search Engine Friendly URLs, they use this format:

/knowledgebase/1/How_do_I_access_my_control_panel.html

You can enable these for MarketConnect landing pages, announcements, downloads, and the knowledgebase sections of the WHMCS Client Area.

Product and Product Group Friendly URLs

We added product group URLs in WHMCS 8.0 and product URLs in WHMCS 8.3.

When you click Edit for a product group or product at Configuration () > System Settings > Products/Services or, prior to WHMCS 8.0, Setup > Products/Services > Products/Services, the system displays a link for the group or various links for the product. You can use these links to direct clients to a specific page or to load the product into their cart and immediately take them to the configuration step for that product.

Link-tab-urls-83.png

For more information, see Linking to WHMCS.

Other Friendly URLs

We added these features in WHMCS 7.2.

You can use the settings in the General tab at Configuration () > System Settings > General Settings or, prior to WHMCS 8.0, Setup > General Settings to configure the following behavior:

  • WHMCS's behavior for other friendly URLs.
  • The mode that WHMCS uses.

WHMCS uses the URI path mode when it constructs URIs, URLs, or relative paths in rendered output (for example, links on pages).

Friendly uri setting.png

For more information about each setting, help for selecting your configuration, and examples of related .htaccess rules, see General Tab.

Friendly Url Simple Mode Select.png

WHMCS is unable to detect the most viable Friendly URL setting for your installation when you have enabled Maintenance Mode because the system defaults to Basic URLs.

Upgrading to WHMCS 7.2

Upon installation (or upgrade to v7.2), WHMCS will perform an evaluation of your current environment. This evaluation will inspect the following:

A. Does the current environment support Apache Mod_Rewrite?

B. Is there an .htaccess file within the WHMCS root directory?

C. If there is an .htaccess file, are the contents identical to the suggested ruleset provided in htaccess.txt of previous WHMCS releases?

D. If there is an .htaccess file, and it is not identical to previous releases' ruleset suggestions, do the contents contain the WHMCS comment marks indicating WHMCS has leveraged this file in the past?

After the evaluation, one of the following will occur:

  • If the current environment is not supported (not A), then Auto-Managed Rewrite is disabled and and no further action will be taken.
  • If the environment is supported (A) and a .htaccess file does exist (not B), Auto-Managed Rewrite will be enabled and a fresh .htaccess file will be created with the latest WHMCS rewrite ruleset. Any future update of WHMCS that requires a change to the rewrite ruleset will be applied automatically during the update process.
  • If the environment is supported (A) and there is an .htaccess file (B), only if the contents are solely WHMCS content (C) or the WHMCS ruleset has been managed by WHMCS automation along with your own custom rules (D) will Auto-Managed Rewrite be enabled. The current .htaccess file will be updated to the current WHMCS ruleset. Any future update of WHMCS that requires a change to the rewrite ruleset will be applied automatically during the update process.
  • If the environment is supported (A) and there is a .htaccess file (B), but it is not solely WHMCS content or there is no indication that WHMCS can manage its rules along side your custom rules (neither C or D), then Auto-Managed Rewrite is disabled and no further action will be taken.