Hello!As an old soldier who has been deeply involved in website operations for many years, I know that a flexible and powerful pseudo-static mechanism is crucial for the search engine optimization (SEO) and user experience of the website.AnQiCMS (English AQCMS) performs exceptionally well in this aspect, providing various out-of-the-box pseudo-static patterns, and allowing us to deeply customize the URL structure, which undoubtedly provides great convenience for refined operations.

Today, let's delve into how to flexibly call the key file path variables in customizing the rewrite rules in Anqi CMS, and how to skillfully use them to create more attractive website URLs.


Unlock the secret of AnQiCMS pseudo-static: A deep analysis of core variables in URL paths

Today, in the increasingly fierce digital marketing environment, a website's URL (Uniform Resource Locator) is no longer just a technical address; it is also a crucial basis for users and search engines to understand web content and evaluate the structure of the website.An SEO-friendly, clean, meaningful URL that can significantly increase the click-through rate and ranking of the website in search engines.Auto CMS is well-versed in this, and its powerful URL rewriting function is precisely designed to meet this need.

The pseudo-static function of AnQi CMS, in short, is to convert dynamic page addresses (such as/?id=123&cat=456)Rewritten by server rules to look like a static HTML file address (for example/news/technology/anqicms-features.html),But in fact, the page content is still dynamically extracted and rendered from the database.This approach maintains the flexibility of dynamic websites while also having the SEO-friendliness and readability of static URLs.When we need to control the URL structure more finely, the custom pseudo-static rules provided by Anqi CMS become our powerful assistant.

Core variable parsing: Dynamic elements in the URL path

In the custom pseudo-static rule configuration interface of AnQi CMS, you will see a series of braces{}The variable wrapped.These variables are not fixed characters but are like 'magic placeholders' that will be dynamically replaced by the corresponding content data when the website runs.Understanding and making good use of these variables is the key to building a perfect URL.

Let's get to know these core variables one by one:

  1. {id}: The unique identity identifier of the data {id}It is the most basic and most commonly used variable, representing the unique digital ID of any content in the system.Whether it is articles, products, categories, or tags, AnQi CMS will assign a unique ID for each.{id}就会被替换为该文章的实际ID,如English/article/123.html。在自定义规则时,如果你希望URL中包含内容的数字ID,English{id}is your preference.

  2. {filename}:内容别名,更具描述性English {filename}是指EnglishDocument or single pageThe custom link name, usually also known as 'slug' or 'alias'. When editing articles or single pages, Anqi CMS will automatically generate a pinyin or English phrase as the default one.filenameYou can also manually modify it. This variable makes the URL more descriptive, allowing you to directly understand the page content through the URL name, for example/products/anqicms-pro.html.{filename}Instead of{id}It can make the URL perform better in search engines and be more user-friendly.

  3. {catname}: The exclusive alias for the categoryWith{filename}is similar,{catname}Used specifically to representCategoryThe custom link name or alias. When creating and editing categories, you can set a unique, meaningful English or pinyin alias for each category. Referenced in pseudo-static rules.{catname}It can build clear classification paths, such as/news/industry-updates/page_1.htmlof whichindustry-updatesis the classificationcatname. This is very helpful for building clear website hierarchy structures.

  4. {catid}: The numeric ID of the classification {catid}In English, it is the unique digital ID of the category. If you tend to use the digital ID in the category URL instead of the alias, or if there are special cases where it is necessary to include both ID and alias to ensure uniqueness,{catid}Could be put to use. For example/category/15.html.

  5. {module}: Model code, distinguishing content typesAnQi CMS supports flexible content models, such as article models, product models, etc.{module}The variable represents the current contentModel table nameor its alias in the URL. For example, the article model may correspondarticle, the product model may correspondproduct.{module}, you can easily distinguish different types of content in the URL, for example/article/latest-news.htmland/product/new-arrivals.htmlThis is especially useful in multi-model websites, making the URL structure more standardized.

  6. {page}The page turning magic.When your content list needs to be displayed in a paginated manner,{page}The variable is particularly important. It will be replaced by the current page number. It should be noted that,{page}The variable must be used in the pseudo-static rule.Using parentheses()wrappedfor example(/ {page})This means that when the URL does not contain pagination information (i.e., the first page), this part of the path will be automatically omitted to keep the URL concise; it will only be displayed when accessing the second page or later page numbers./page_2This is a very elegant way to handle pagination URLs, or something similar.

Combination of rules and application scenarios

In the pseudo-static rules setting of AnQi CMS backend, you can define rules for six different page types, they are:

  • archive: Document detail page (such as articles, product details)
  • category: Document list page (category page)'} ]
  • archiveIndex:Model homepage (such as article list homepage)
  • page:Single Page Detail Page
  • tagIndex:Tag homepage
  • tag:Tag document list page

Each rule is followed规则名===规则值format. For example, if you want the URL of the article detail page to be/article/文章别名.htmlYou can configure it like this:.

archive===/article/{filename}.html

Here are some common rule examples of friendly URLs combined with the above variables, which you can adjust according to your actual needs:.

  • Document detail page (such as articles):

    • /news/{filename}.html(Recommended: high readability, includes keywords)archive===/news/{filename}.html
    • /{module}/{id}.html(General: applicable to various content models, short path)archive===/{module}/{id}.html
  • Document list page (category page):

    • /{catname}(/{page}).html(High readability, elegant pagination)category===/{catname}(/{page}).html
    • /{module}/{catid}(/{page}).html(Number ID, pagination elegance)category===/{module}/{catid}(/{page}).html
  • Model homepage (e.g., product homepage):

    • /products.html(Concise and clear)archiveIndex===/products.html
    • /{module}/list.html(Universal, distinguished by model)archiveIndex===/{module}/list.html
  • Single page detail page (e.g., about us):

    • /about-us.html(Direct alias, clear)page===/{filename}.html
  • Label document list page:

    • /tags/{id}(/{page})(Number ID, pagination elegance)tag===/tags/{id}(/{page})
    • /tag/{filename}(/{page})(Alias, pagination elegant)tag===/tag/{filename}(/{page})

Remember,{page}Variables must be enclosed in parentheses()so that when accessing the first page,/The pagination part behind will be automatically omitted, for example/news/industry-updates/, rather than/news/industry-updates/page_1which makes the URL more concise and standardized.

Practical suggestions and precautions.

When configuring custom pseudo-static rules, there are some tips that need to be shared with you:

  1. **Keep it concise and readable