In website operation, the display format of the front-end link (URL) is crucial for user experience, search engine optimization (SEO), and brand image.An concise, meaningful and well-structured URL can not only help users better understand the content of the page, but also improve the efficiency of search engine crawling and ranking.The AnQiCMS (AnQiCMS) fully understands this requirement and provides a flexible custom URL alias function, allowing us to precisely control the link display of categories, documents, and single pages on the front end of the website according to our needs.

Understand the importance of front-end links and pseudo-statics

Before delving into custom URL aliases, we need to understand the concept of 'pseudo-static'.The term pseudo-static refers to the use of URL rewrite technology to convert dynamic web page addresses (usually containing question marks and parameters) into addresses that look like static pages (usually ending with .html, .htm, or in directory form).AutoCMS has built-in powerful pseudo-static functions. In this way, our website links are more readable and more friendly to search engines, thus effectively improving SEO effects.

The pseudo-static settings of AnQi CMS are mainly located in the 'Function Management' menu under the 'Pseudo-Static Rule' in the backend.Here, we can choose several preset rules of the system, such as "numeric patternBut when we need a more refined and personalized link structure, 'Custom Mode' becomes our first choice.

Custom URL Alias: The Foundation of Fine-grained Link Management

Custom URL aliases are a core feature of AnQi CMS, allowing us to assign a unique, descriptive English identifier to each category, document, and single page within the website.This identifier is the specific name it has in the frontend link, and it is the basis for constructing personalized URL structures.

  1. URL Alias Setting for Category Page:When creating or editing categories, under the 'Content Management' section, find the 'Document Categories' interface, and you will see an input box named 'Custom URL'.System will automatically generate a pinyin alias based on the category name we fill in, for example, 'News Information' might generate 'xinwenzixun'.If this automatically generated alias does not meet our expectations, we can manually modify it, changing it to a more meaningful English word or phrase, such as 'news-updates'.{catname}This variable is used to refer to the custom URL alias of the category.

  2. Document page URL alias setting:For each document, whether it is an article or a product, we can also set its alias in the "Custom URL" field under "Content Management" in the "Add Document" or "Edit Document" interface.By default, the system will automatically generate aliases based on the document title, for example, a document named “安企CMS快速入门” may have an alias like “anqicms-quick-start”.We can also manually modify it to 'get-started-anqicms' and other similar options to make it more concise and clear.{filename}This variable is used to refer to the custom URL alias of the document.

  3. Single page URL alias setting:Single-page, such as “About Us”, “Contact Us”, etc., when editing under “Page Resources” in “Page Management”, the “Custom URL” option is also provided.Similar to categories and documents, we can set the alias of the page content to 'about-us', 'contact', etc., to enhance the intuitiveness of the URL.{filename}Variable to refer to.

Tip:When setting a custom URL alias, the system will automatically check its uniqueness across the entire site.If a conflict is found, the system will automatically add a random number to the alias to ensure uniqueness, therefore, it is recommended that we try to ensure its uniqueness when setting manually to keep the URL tidy.{module}a variable.

Advanced: Implement fine-grained link structure through custom rewrite rules

Just set the alias, which is not enough to fully control the display form of the front-end link.The true power lies in the 'Custom Pattern' under the 'URL Rewrite Rules' in 'Function Management'.Here, we can define a set of our own URL structure rules and apply the custom URL aliases set before.

Select "Custom mode" to configure in six groups of rules such as document details, document list, single page, etc. Each rule follows规则名===规则值The format. The key is to use the variables provided by the safe CMS:

  • {id}: Data ID, usually used for links with pure numbers.
  • {filename}: Custom URL alias for documents or single pages.
  • {catname}The custom URL alias of the category.
  • {module}:Content model URL alias.
  • {page}Page number.

Here are some examples of custom rules:

  • Implement the URL structure for category name/document name:If you want the URL of the article detail page to be你的域名/分类别名/文档别名.htmlYou can set up the rewrite rule like this:archive===/{catname}/{filename}.htmlThe category list page might be:category===/{catname}/

  • Implement the URL structure for the module prefix/document name:If your website has a lot of content models (such as articles, products), you want the document links of different models to have model name prefixes, for example你的域名/article/文档别名.htmlYou can set it like this:archive===/{module}/{filename}.html

  • Custom single page URL:For a single page, if you want the URL for the "About Us" page to be你的域名/about-us.htmlIn addition to setting the alias to “about-us” in the single-page management, you also need to ensure that the rule matches in the pseudo-static rules.page===/{filename}.html(If general, or more specifically for a single page)page/about-us.html, but this usually refers to the template file name, not the pseudo-static rules themselves)

By flexibly combining these variables, we can create URL structures that meet the needs of our own website, both beautiful and beneficial for SEO.

Summary of operation process

  1. Set alias:In the "Content Management
  2. Configure pseudo-static rules:Enter the "Function Management" "URL Rewrite Rules
  3. Define the rule:Use according to the required URL structure,{filename}/{catname}/{module}Variables, write the corresponding pseudo-static rules.
  4. Save and test:After saving the rules, be sure to clear the website cache and visit the relevant pages on the front end to check if the URL is displayed as expected and whether the page content is loaded normally.

Precautions

  • Uniqueness is key:Whether it is a category, document, or custom URL alias for a single page, it should ensure the uniqueness throughout the entire site to avoid link conflicts and parsing errors.
  • SEO friendliness:The URL structure should be concise, contain keywords, and avoid being too long or including too many unnecessary parameters.Using custom URL aliases can significantly improve the performance of a website in search engines.
  • Changes should be made with caution:Frequent modification of URL structure or alias may affect the indexing and ranking of the website by search engines.If it is indeed necessary to modify a published URL, it should be coordinated with the 301 redirect function provided by the Anqi CMS to correctly direct the old link to the new link, to avoid traffic loss and the generation of dead links.
  • Test is essential:Any modification to pseudo-static rules or custom URL aliases must be fully verified in the test environment to ensure that all pages can be accessed normally.

Through the custom URL alias and rewrite rules provided by Anqi CMS, we can fully control the display of the website's front-end links, providing users with a better browsing experience and laying a solid foundation for the website's SEO.


Common Questions (FAQ)

**1. Modified the custom URL alias