How to customize the pseudo-static URL structure in Anqi CMS, what variables can be used?

Calendar 👁️ 57

As an experienced website operator familiar with AnQiCMS, I know that a friendly and logical URL structure is crucial for the website's search engine optimization (SEO) and user experience.AnQiCMS provides powerful flexibility in customizing static URL structures, allowing us to design the most suitable link format for the website according to specific needs.

Custom URL Structure Guide in AnQiCMS

Static URL, as the name implies, is a technology that makes dynamic pages look like static pages.It not only enhances the user's understanding of the URL, but also allows search engine spiders to more effectively crawl and index page content, thereby improving the website's SEO performance.AnQiCMS provides comprehensive support in this aspect, whether through built-in modes for quick configuration or through customized rules for fine-tuning, it can meet the operation needs of various websites.

AnQiCMS Static URL Function Overview

One of the core features of AnQiCMS is pseudo-static and 301 redirect management.This enables us to optimize the URL structure of the website, effectively manage the traffic redirection after page adjustments, and avoid the loss of SEO assets.The system design takes into account SEO-friendliness, and therefore provides multiple configuration options in the URL structure.Since the AnQiCMS v2.0.0-alpha version, the system has introduced the function of custom URL static rules, which greatly enhances flexibility.

Built-in Static URL Rule Options

For easy and quick deployment, AnQiCMS is built with four commonly used pseudo-static rules to meet the basic needs of different types of websites. These patterns usually cover the common URL habits of Chinese and English stations:

The number mode: In this mode, the URLs of document details, document lists, single-page details, and document tag pages are mainly{id}Used as a basis for generation, suitable for Chinese websites with high requirements for ID identification.

Model naming pattern: This pattern is more suitable for English websites, as it constructs URLs based on the model name of the content.

Category naming pattern 1 and category naming pattern 2: These two patterns provide URL structures based on category names, optimized for the habits of Chinese and English websites.

For most websites, the built-in mode is sufficient to meet basic needs.But when we have more personalized and refined control requirements for the URL structure, custom mode becomes particularly important.

Custom configuration for pseudo-static rules

AnQiCMS's custom pseudo-static mode is an advanced feature that allows us to define individual URL structures for the six main page types of the website. These page types include:

  • Document details page (archive)
  • Document list page (category)
  • Model homepage (archiveIndex)
  • Single page (page)
  • Tag list page (tagIndex)
  • Tag detail page (tag)

When configuring custom rules, each rule follows规则名===规则值format. For example,archive===/{module}-{id}.htmlThis is a custom rule defined for the document detail page. Properly configuring these rules is crucial for ensuring normal website access and optimizing SEO.

Available URL variables

In the custom static rule, AnQiCMS provides a series of variables that can be flexibly combined to build URL structures that meet specific needs. Understanding and skillfully using these variables is the foundation for advanced customization:

Data ID ({id}This variable represents the unique identifier for specific content, such as an article, product, or single page ID.It is usually used in the URL of the detail page to distinguish different content items.

Custom data link name ({filename}This is a very practical variable, allowing us to customize a short and descriptive link alias for a single document, single page, or tag.In the editing interface of documents, categories, tags, and single pages, there will always be an option for 'Custom URL'.If we fill in a custom URL and use in the pseudo-static rules{filename}Then the system will prioritize using the alias we set.If not manually filled in, the system will automatically generate a pinyin alias based on the title.It should be noted that the custom link name must ensure that it is unique throughout the entire site. If it is duplicated, the system will automatically add random numbers to ensure its uniqueness.It can only contain letters, numbers, and underscores, and cannot contain spaces.

Custom category link name ({catname}): And{filename}Similar, this variable is dedicated to document classification. We can set a custom link alias for the category on the category editing page and proceed through{catname}The variable is used in the URL. It also needs to ensure the uniqueness across the entire site, and only supports letters, numbers, and underscores.

Category ID ({catid}This variable represents the unique ID of the content category. It is often used in document list pages or category detail pages in URLs to identify a specific category.

Model table name ({module}This variable represents the table name in the database of the model to which the content belongs (such as article model, product model, etc.), or the URL alias set during backend configuration.It helps to reflect the type of content in the URL.

Page number ({page}): When the page has pagination, this variable will display the current page number. When using{page}there is an important syntax rule, that is, it must be placed inside parentheses, for example(-{page})This ensures that there is no extra pagination information in the URL when there is no pagination or on the first page.

Configuration examples and precautions

Let us understand the combination application of these variables through a specific example:

Suppose we want the URL format of the document detail page to be:/article-123.html, the document list page is:/list-news(-2).htmlof whichnewsIs a category alias,2Is a page number. We can configure it like this:

archive===/{module}-{id}.html
category===/{catname}(-{page}).html
archiveIndex===/{module}.html
page===/{filename}.html
tagIndex===/tags(-{page})
tag===/tag-{id}(-{page})

In this example:

  • archive===/{module}-{id}.html: Will generate the document URL similar to/article-123.htmlin the form ofarticleIs a model alias,123Is the document ID.
  • category===/{catname}(-{page}).html: If the category alias isnewsThe URL for the first page of the category list may be/news.htmlAnd the second page is/news-2.html.

When configuring custom pseudo-static rules, be sure to pay attention to the following points:

  1. The correctness of the rulesAny syntax error can cause the page to become inaccessible, so it should be tested carefully after modification.
  2. Reasonable use of variables.: Choose the variable that best describes the page content and keep the URL concise.
  3. Uniqueness guarantee: For{filename}and{catname}Ensure it is unique when set in the background; otherwise, the system will automatically append numbers.
  4. Nginx/Apache configuration: The activation of pseudo-static rules still requires server-side Nginx or Apache configuration to cooperate, ensuring that requests can be correctly routed to AnQiCMS processing.In the AnQiCMS help documentation, examples of Nginx and Apache reverse proxy configurations are provided, which are necessary prerequisites for the pseudo-static rules to work properly.

By carefully designing and configuring the pseudo-static URL structure, we can not only provide users with clear and memorable links, but also help the website win better visibility and ranking in search engines, thereby achieving the goals of content marketing and traffic growth.AnQiCMS provides this capability, which is an indispensable tool for website operators.


Frequently Asked Questions (FAQ)

1. I have configured custom rewrite rules, but the website page shows a 404 error, how should I troubleshoot?First, please check the syntax of the custom pseudo-static rules you have set in the AnQiCMS backend, especially like{page}Whether this variable is correctly enclosed in parentheses. Secondly, make sure that your server (Nginx or Apache) configuration file has also been updated accordingly and restarted to correctly parse the new URL structure and forward it to AnQiCMS for processing.You can refer to the AnQiCMS help document for the part related to Nginx or Apache pseudo-static settings and check it.Finally, if your page content itself has a "custom URL" field, please confirm that the value is unique and conforms to the specifications.

2. Can I use Chinese in custom static URLs?May not. Although some custom URLs of AnQiCMS (such as documents, the 'custom URL' field of categories) will automatically convert Chinese titles to pinyin if not manually filled in, but in the variables of pseudo-static rules (such as{filename}/{catname}/{module}In addition to the manually entered custom link name, it is strongly recommended and usually only supported to use letters, numbers, and underscores.Using Chinese or other non-English characters may cause URL parsing errors or compatibility issues, which is not conducive to SEO.

3. If I set{filename}or{catname}Unique, how will AnQiCMS handle it?AnQiCMS tries to ensure the uniqueness of all custom links within the website. If the system detects that you have set a custom URL for documents, categories, or tags, that is{filename}or{catname}The value) is duplicated with other existing URLs, and it will automatically append a random number to the repeated URL to ensure uniqueness.Although this can avoid conflicts, but in order to maintain the simplicity and predictability of the URL, it is recommended that you try to ensure its uniqueness when setting a custom URL.

Related articles

Which modes of static rules does AnQi CMS have, and which one is most friendly to SEO?

As a website operator who has been deeply involved with AnQiCMS for many years, I know the importance of URL structure for website operations, especially for Search Engine Optimization (SEO).A clear and meaningful URL not only enhances user experience but also helps search engines better understand and crawl website content, thereby affecting the ranking performance of the website.The AnQi CMS is well-versed in this, providing various static rules to meet the needs of different websites.The pseudo-static rules of AnQi CMS, the core is to convert dynamic URLs (such as `/')

2025-11-06

What are the uses of the 'Built-in Link', 'Category Page Link', and 'External Link' in the AnQi CMS navigation link?

In the daily operation of Anqi CMS, navigation links are the first hurdle for users to interact with website content, and they are also crucial for search engines to understand the website structure.As an experienced website operator proficient in content creation, editing, publishing, and optimization, I know that the setting of each navigation element affects user experience and SEO performance.The Anqi CMS provides three main types of navigation link types: built-in links, category page links, and external links, each playing a different role, together building an efficient website navigation system.

2025-11-06

How to customize Anqi CMS navigation categories, and achieve footer or sidebar navigation?

As a website operator who deeply understands the operation of AnQiCMS, I know the importance of a flexible and user-friendly navigation system for improving the discoverability and user experience of the website.The AnQi CMS provides powerful and intuitive navigation customization features, making it easy to deploy special navigation in the footer, sidebar, or any other area.The following will elaborate on how to customize navigation categories in AnQi CMS to achieve footer or sidebar navigation.### Understand the navigation system of AnQi CMS In AnQi CMS

2025-11-06

How can AnQi CMS create multi-level navigation menus, and does it support dropdown sub-menus?

As an experienced AnQiCMS website operations personnel, I know the importance of a clear and efficient navigation system for user experience and search engine optimization (SEO).High-quality navigation not only helps users quickly find the information they need, but also guides search engine spiders to effectively crawl website content, improving the overall performance of the website.The AnQi CMS provides an intuitive and flexible solution for creating and managing navigation menus, perfectly supporting multi-level menu structures.###

2025-11-06

What problems can be caused by incorrect configuration of pseudo-static rules, and how to investigate and avoid them?

As an experienced enterprise CMS website operation staff member, I am well aware of the importance of website URL structure for user experience and search engine optimization.AnQi CMS provides a powerful and flexible static rule configuration function, especially its 'custom mode', which provides great freedom for the URL display form of our website content.However, this flexibility also comes with potential risks. If the custom static rule configuration is not set properly, it may affect the access to some pages, or even cause the entire website to crash, bringing unnecessary trouble to the website operation.###

2025-11-06

How to configure the Baidu and Bing search engine active push interface in Anqi CMS to accelerate inclusion?

As an experienced CMS website operation personnel of an enterprise security company, I fully understand the importance of content creation and publishing efficiency, and I am well aware of how to ensure that our carefully crafted content can be quickly discovered and indexed by search engines.In the era of content being king, the timely inclusion of search engines is a key link in fully realizing the value of content.The Anqi CMS was designed with SEO optimization needs in mind, one of its core features is its powerful search engine主动推送interface, which can significantly accelerate the process of website content indexing.

2025-11-06

How to verify after setting up link push, whether Anq CMS has successfully pushed the new content to the search engine?

As an experienced CMS website operation person, I fully understand your desire for your content to be quickly indexed by search engines.AnQiCMS (AnQiCMS) provides strong support in content publishing and optimization, among which the link push feature is a key factor to ensure that new content can be discovered by search engines in a timely manner.After configuring the push interface, verifying its effect is an important step to ensure the maximum value of your content.The following will elaborate on how to verify whether Anqi CMS has successfully pushed new content to search engines.

2025-11-06

How to add JS automatic submission code for search engines like 360 and Toutiao in Anqi CMS?

AnQi CMS, as an efficient and SEO-optimized content management system, fully understands the importance of website content being indexed by search engines in a timely manner.Although for major search engines like Baidu and Bing, we can implement active push through API interfaces to accelerate inclusion, but in the face of platforms mainly relying on JavaScript code for automatic submission, such as 360 Search and Toutiao, Anqi CMS also provides a simple solution.

2025-11-06