As an experienced CMS website operation personnel of Anqi, I fully understand that a high-quality URL structure is crucial for the website's search engine optimization (SEO) and user experience.A clear, meaningful, and easily graspable URL that not only helps search engines better understand the page content, but also gives users a sense of direction when visiting.AnQiCMS provides great flexibility in setting up pseudo-static rules, especially with its custom mode, which allows operators to finely adjust the URL structure according to specific needs.

The core value of AnQiCMS pseudo-static rules

The built-in pseudo-static function of AnQi CMS aims to convert dynamic URLs into static or pseudo-static URLs, which is crucial for improving the SEO performance and user-friendliness of the website.Search engines prefer static URLs that are structured simply and contain keywords, as this helps them better parse and index page content.At the same time, users also find it easier to understand and remember this type of URL, thereby improving the overall accessibility of the website.AnQiCMS provides several predefined pseudo-static rules, such as numeric patterns and model naming patterns, to meet common application scenarios.However, for operators who pursue the ultimate SEO effect and personalized URL design, customizing the static rules is undoubtedly the key to bringing out the powerful functions of AnQiCMS.

Enable custom pseudo-static rules

To start customizing the pseudo-static rules, we need to enter the "Function Management" module of the AnQiCMS backend and then select "Pseudo-static Rules".Here, the system will provide a variety of built-in rules for selection. To enable custom configuration, you need to switch to 'Custom Mode'.The custom mode allows you to define the URL structure for different page types on the website, including document detail pages, category list pages, model home pages, single pages, tag list pages, and tag detail pages.Each rule is composed in the form of "rule name===rule value" and is constructed into a unique URL path through a combination of specific variables.

Common variables supported by AnQiCMS custom pseudo-static rules

When customizing pseudo-static rules, AnQiCMS provides a series of flexible variables that allow you to build rich URL structures according to content characteristics and SEO strategies. These variables are enclosed in curly braces{}Wrap, convenient for system identification and replacement with actual content.

Content ID ({id})

This variable represents the unique digital identifier for each item on the website.Whether it is an article, product, single page or tag, each entity has a corresponding ID in the database. Use{id}It can ensure the uniqueness of the URL, especially suitable for those scenarios where content titles may be duplicated or require concise URLs. For example, the URL of an article detail page can be set as/article/{id}.html.

Custom data link name ({filename})

{filename}The variable is the content (such as articles, single pages, tags) that is manually set by the user or automatically generated by the system as a URL alias when created or edited.It is usually a short, descriptive English or Pinyin string, an important tool for optimizing URL keywords.Embedding keywords in the URL can enhance the search engine's understanding of the page topic, which may lead to better ranking.For example, an article about an SEO guide, its URL can include/article/seo-guide.htmlof whichseo-guideit is{filename}the value.

Custom category link name ({catname})

with{filename}similar,{catname}A variable used to represent the custom URL alias of a category. It is also an optimized string used to describe the theme of the category. It is used when constructing the URL of the category list page.{catname}It makes the URL more semantically and readable. For example, a category about "news" might be designed as/news/{catname}/list.htmlof which{catname}The value can belatest-news.

Category ID ({catid})

This variable represents the unique identifier for the category. Although it may not be as good in SEO as{catname}intuitive, but{catid}It is very useful when you need to accurately point to a specific category by number ID, or as a concise URL pattern. The URL of a category list page may be set as/category/{catid}/list.html.

Model table name ({module})

{module}The variable represents the model identifier of the content. In AnQiCMS, you may have different content models such as 'article (archive)', 'product (product)', etc.{module}The URL alias will be automatically replaced for the model, helping to build a hierarchical URL structure. For example, the URL rule for the article detail page can be defined as/{module}/{filename}.htmlSo for an article, its URL might be/article/my-first-post.html.

Page number ({page})

{page}The variable is used to handle pagination on list pages. Its special feature is that it usually needs to be with parentheses()Combine to indicate that it is optional. For example(-{page})This means that when the list has only one page, no pagination information will appear in the URL, keeping the URL concise; when there are multiple pages, the URL will automatically add page numbers, for example/category/tech-news/page-2.htmlThis design avoids the appearance on the homepagepage-1Such redundant information is more SEO-friendly

Flexible combination to build the optimal URL

By flexibly combining the above variables, you can build URL structures for the AnQiCMS website that are both search engine friendly and meet user habits. For example, a common combination of custom rules may look like this:

  • Document detail page: archive===/{module}/{filename}-{id}.html
    • Example:/article/anqicms-tutorial-123.html
  • Category list page: category===/{catname}/list(-{page}).html
    • Example:/news/company-updates/list.html(Page 1)
    • Example:/news/company-updates/list-2.html(Page 2)
  • Single Page: page===/{filename}.html
    • Example:/about-us.html

When configuring custom rewrite rules, please be sure to test each rule carefully to ensure that it can be correctly parsed to the corresponding page, and pay attention to avoid creating duplicate or conflicting URLs.A well-planned URL structure is one of the foundations for long-term success of a website, and the AnQiCMS custom rewrite function provides strong support for this.

Frequently Asked Questions (FAQ)

1. What should I do if the website shows a 404 error page after modifying the custom static rules?

After you modify the伪static rule and encounter a 404 error, please first check if the syntax of your rule is correct, especially whether the variable names and delimiters meet the requirements of AnQiCMS.Secondly, make sure that your server's (such as Nginx or Apache) rewrite rules are correctly configured and point to the entry file or reverse proxy port of AnQiCMS.You may also need to clear the AnQiCMS system cache to ensure that the new rules take effect.If an old URL exists, it is strongly recommended to use the built-in 301 redirect function of AnQiCMS to permanently redirect the old URL to the new URL to avoid SEO loss and a decline in user experience.

2. When customizing the URL,{filename}or{catname}How is the value generated? Can I control it manually?

{filename}and{catname}The value is usually automatically generated by the system in the title you enter when creating or editing articles, products, single pages, or categories.You can find the "Custom URL" field on the edit page and manually modify these values according to your SEO needs.To optimize for SEO, it is recommended to set it to keywords highly relevant to the page content and ensure its uniqueness throughout the site.If the value entered manually is not unique, the system usually appends a random character to the end to ensure uniqueness.

3.{page}Variable(-{page})What special meaning does the format have? Why is it used this way?

(-{page})The format indicates the pagination page number{page}It is an optional part of the URL. It is usually used on list pages, and the URL will not be displayed when the list has only one page.(-1)orpage-1For example, such pagination information,/category/tech-news/list.htmlWhen the list has a second page and more pages, the URL will automatically add the page number, for example/category/tech-news/list-2.htmlThis design has two major advantages: one is to maintain the conciseness of the URL and avoid unnecessary redundant information; the other is to be more SEO-friendly, preventing search engines from treating the "first page" URL of no actual pagination (such as/list-1.htmlMisidentified as duplicate content, thereby optimizing the efficiency of crawling and weight distribution.