How to control the display form of the front-end link of category, document, and single page through custom URL alias?

Calendar 👁️ 109

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

Understand the importance of frontend links and pseudo-statics

Before delving into custom URL aliases, we need to understand the concept of 'pseudo static'.Static URLs are a technique used to rewrite URLs of dynamically generated web pages, converting them into addresses that look like static pages (usually ending with .html, .htm or directly as a directory format).The Anqi CMS is built with powerful pseudo-static functionality, which makes our website links more readable and more friendly to search engines, thereby effectively improving SEO effectiveness.

The pseudo-static settings of AnQi CMS are mainly concentrated in the "Pseudo-static Rule" under the "Function Management" menu in the background.Here, we can choose from several predefined rules of the system, such as 'number pattern', 'model naming pattern', or 'category naming pattern', which can meet the needs of most websites.But when we need a more fine-grained, personalized link structure, "custom mode" becomes our preferred choice.

Custom URL alias: the cornerstone of refined link management

The custom URL alias is a core feature of AnQi CMS, which allows us to assign a unique, descriptive English identifier to each category, document, and single page on the website.This identifier is the specific name in the front-end link, which is the basis for constructing personalized URL structures.

  1. URL alias setting for category pages:When creating or editing categories, under the "Content Management" section, find the "Document Category" interface, and in the "Other Parameters" section, you will see an input box named "Custom URL".The system will automatically generate a pinyin alias based on the category name we fill in, for example, "News Information" may 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'.In custom rewrite rules, we can use{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 the "Content Management" section when adding or editing a document interface.By default, the system will automatically generate aliases based on the document title, for example, a document named "Anqicms Quick Start" may have an alias such as "anqicms-quick-start".We can also manually modify it to 'get-started-anqicms' and so on, making it more concise and clear.In custom pseudo-static rules, we can use{filename}This variable is used to reference the custom URL alias of the document.

  3. Single page URL alias setting:A single page, such as "About Us", "Contact Us", etc., when editing under "Page Resources" in "Page Management", it also provides an option for "Custom URL".Similar to categories and documents, we can set aliases for it based on page content, such as "about-us", "contact", etc., to enhance the intuitiveness of the URL.Just like the document page, the alias of the single page also goes through the custom static rules{filename}Variable to reference.

Tip:When setting a custom URL alias, the system will automatically check its uniqueness throughout the entire site.If a conflict is found, the system will automatically add a random number to the alias to ensure uniqueness. Therefore, to keep the URL tidy, it is recommended that we try to ensure its uniqueness when setting manually.Moreover, for the URL alias of the content model, it can be set under "Content Management" -> "Content Model", which is usually used to define the common prefix for all content under the model, corresponding to the static rules in pseudo-static rules.{module}Variable.

Advanced: Implementing fine-grained link structure through custom pseudo-static rules

Only the alias has been set, it is not enough to completely control the display form of the front-end link.The real power lies in the "custom mode" under the "pseudo-static rule" of the "function management".Here, we can define a set of our own URL structure rules and apply the custom URL alias set earlier.

After selecting "Custom mode", we can 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 Anqi CMS:

  • {id}: Data ID, usually used for links with pure numbers.
  • {filename}: Custom URL alias for documents or single pages.
  • {catname}Custom URL alias for a category.
  • {module}URL alias for content model.
  • {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 pseudo-static rules like this:archive===/{catname}/{filename}.htmlAnd the category list page might be:category===/{catname}/

  • Implement the URL structure for module prefix/document name:If your website has many content models (such as articles, products), you want the document links of different models to have a model name prefix, 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 of the "About Us" page to be你的域名/about-us.htmlIn addition to setting the alias to "about-us" in the single-page management, it is also necessary to ensure that the pseudo-static rules match:page===/{filename}.html(If general, or more specifically for a single page specification)page/about-us.htmlBut this usually refers to the template filename, not the pseudo-static rules themselves)

By flexibly combining these variables, we can create a URL structure that meets the needs of our own website, both aesthetically pleasing and beneficial for SEO.

Summary of operational process

  1. Set alias:In the "Content Management" section, under "Document Categories", "Add/Edit Document", and "Page Resources" page management, manually set or modify the "Custom URL" alias according to the actual content for categories, documents, and single pages.
  2. Configure pseudo-static rules:Enter the "Function Management" under the background "URL Rewrite Rule", select the "Custom Mode".
  3. Define the rule:Use according to the required URL structure,{filename}/{catname}/{module}Wait for variables, write the corresponding pseudo-static rules.
  4. Save and test:After saving the rules, be sure to clear the website cache and access the relevant pages on the front end to check if the URL is displayed as expected and whether the page content loads normally.

Points to note

  • Uniqueness is crucial: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 a website's performance in search engines.
  • Change with caution:Frequent changes to the URL structure or aliases may affect the search engine's inclusion and ranking of the website.If it is indeed necessary to modify the published URL, it should be done in conjunction with the 301 redirect function provided by AnQi CMS, to correctly direct the old link to the new link, avoiding traffic loss and dead link generation.
  • Testing is essential:Any changes to pseudo-static rules or custom URL aliases must be thoroughly verified in the testing environment to ensure that all pages can be accessed normally.

By using the custom URL alias and pseudo-static rules provided by AnQi CMS, we can fully control the display of the website's front-end links, providing users with a better access experience and laying a solid foundation for the website's SEO.


Frequently Asked Questions (FAQ)

**1. Modified the custom URL alias

Related articles

Does AnQiCMS support automatically appending a thumbnail parameter to the image address for display?

In website content operation, images are undoubtedly an important element to attract visitors, and the loading speed and display effect of images directly affect the user experience.To optimize website performance, it is particularly important to use thumbnails reasonably.Many website systems generate or call different-sized images by appending parameters to the image address.How does AnQi CMS handle this aspect?Does it support automatically appending a thumbnail parameter to the image URL to display?

2025-11-09

How to accurately截取string or HTML content and add an ellipsis to adapt to layout requirements?

In website content operation, we often encounter such needs: In order to keep the page layout neat and the reading experience smooth, it is necessary to truncate the long text (whether it is plain text or content containing HTML tags) and add an ellipsis at the end.AnQiCMS provides very practical template filters that can help us accurately complete this task while ensuring that the content display is both beautiful and does not destroy the HTML structure.### Understanding the extraction requirements and the solution of AnQiCMS Imagine, in an article list

2025-11-09

How to conditionally display elements in a template based on whether the content contains specific keywords?

In website operation, we often hope that the content can be presented more intelligently to visitors.For example, if a technical article mentions a specific product, we may want to automatically display the product's recommendation information at the top or side of the article;If the product description contains the phrase 'Limited Edition', we would like to add an eye-catching 'Limited' badge next to the product image.This ability to conditionally display elements based on whether the content contains specific keywords can greatly enhance the user experience and operational efficiency of the website.AnQiCMS as an efficient and flexible content management system

2025-11-09

How does AnQi CMS support displaying multilingual switch links and hreflang tags in the front-end template?

Today, with the increasing trend of globalization, many websites need to provide services to users from different countries and regions.This means that the website must not only support content display in multiple languages but also ensure that search engines can correctly identify these different language versions, thereby enhancing the visibility in the international market.AnQiCMS as a practical content management system provides strong and flexible support in this aspect.

2025-11-09

How to dynamically display the document title of the current page in AnQiCMS templates?

In AnQi CMS template design, dynamically displaying the document title of the current page is a basic and important function.It not only concerns the intuitive experience of users when browsing the website, but is also an indispensable part of search engine optimization (SEO) strategy.AnQi CMS provides a simple and efficient way to meet this requirement, let's explore how to flexibly use it in templates.

2025-11-09

How to use the `archiveList` tag to display the latest article list of a specified category on the AnQiCMS homepage?

On AnQiCMS, the homepage is the first stop for visitors to understand your content, therefore, it is crucial to display the latest and most relevant articles efficiently.AnQiCMS provides a powerful and easy-to-use template tag system, where the `archiveList` tag is your reliable assistant for accurately displaying the latest articles of a specified category on the homepage.### `archiveList` tag introduction: The core of the home page dynamic content The `archiveList` tag is a core tool in the AnQiCMS template engine used to obtain the document list

2025-11-09

How to implement multilingual content switching and correct display on the front end of AnQiCMS website?

When building a website for global users, providing multilingual content is a crucial step.AnQiCMS as a comprehensive content management system provides flexible and powerful support to achieve this goal.This article will discuss in detail how to implement multi-language content switching and correct display on the AnQiCMS website.## Global Website Creation: AnQiCMS Overview of Multilingual Capabilities AnQiCMS's multilingual support is designed to help website operators easily meet the needs of global content promotion.

2025-11-09

How to get and display the record number and copyright information of the website in the AnQiCMS template?

In the operation of the website, the filing number (ICP) and copyright information are essential elements for building user trust and compliance with laws and regulations.It is crucial to clearly display this information for websites built using AnQiCMS, whether it is a corporate website or a personal blog.Luckily, AnQiCMS provides a very intuitive and flexible way to manage and display this content. Next, we will together learn how to obtain and display the website filing number and copyright information in the AnQiCMS template.

2025-11-09