Optimize SEO, improve user experience: AnQiCMS Custom Article Detail Page URL Static Rule Explanation

In website operation, a clear and meaningful URL structure is crucial for search engine optimization (SEO) and user experience. Imagine a user sees/article.php?id=123&category=newsSuch a link, and see/news/anqicms-url-guide.htmlWhich link would be more attractive to them to click? Clearly, the latter.This is the charm of the static rule. AnQiCMS, as a fully functional content management system, fully considers this point and provides us with powerful static configuration capabilities, especially for the URL of the article detail page, which can be highly customized according to our needs.

Why is it so important to customize URL static rules?

Static rules, simply put, are to convert those dynamic, parameterized web page addresses (such asarticle.php?id=123), rewritten using technical means to look simpler and more like a static page address (for example/article/123.html). The benefits are obvious:

  1. Improve SEO performance:Search engines prefer concise, keyword-rich static URLs. They can help search engines better understand the content of the page, thereby possibly achieving better rankings.
  2. Enhance user experience:Users can roughly understand the content of the page through the URL, making it easier to remember and share, and also enhancing the professionalism of the website.
  3. Avoid duplicate content:Dynamic URLs may generate multiple links pointing to the same content in some cases, static aliasing helps unify the entry point and avoid being misjudged as duplicate content by search engines.

AnQiCMS emphasized SEO-friendliness from the beginning of its design, and built in features for pseudo-static and 301 redirect management, allowing us to easily achieve these optimizations.

Learn about the AnQiCMS pseudo-static rule configuration entry

To customize the URL static rules of the article detail page, we need to enter the AnQiCMS backend management interface. In the backend navigation, find“Function Management”and then click“Static Rules”This is where we perform URL customization magic.

The system provides four preset pseudo-static rules by default, such as 'number mode', 'model naming mode', etc., which are convenient and quick, and can meet the needs of general websites. But if we want to control the URL structure more finely, we need to chooseCustom Mode.

Customize deeply: Create a dedicated article detail page URL

Under the "Custom mode", you can see multiple rule groups, each corresponding to different types of pages, such as article detail pages, category list pages, single pages, etc. We need to focus on“archive”This rule is specifically used to define the URL structure of the article detail page.

Each custom rule follows the format "rule name===rule value". For the article detail page, the rule name is fixed asarchiveThe rule value part is what we use to define the URL structure. Here, AnQiCMS provides some very useful variables that can be combined flexibly:

  • {id}:Represents the unique numeric ID of the article. This is the most basic identifier.
  • {filename}:The field for the custom URL you entered during article editing.This field allows you to set a unique, more descriptive English or pinyin alias for each article, which is the core of SEO-friendly URLs.
  • {module}:Represents the URL alias of the content model to which the article belongs. This alias can be set in "Content Management" -> "Content Model".
  • {catname}:Represents the URL alias of the article category. This alias can be set for each category in "Content Management" > "Document Categories".
  • {catid}:Represents the unique numeric ID of the article category.
  • {page}:Used for pagination, usually on the article list page, and generally not involved on the article detail page, but understanding its existence is beneficial and harmless.

These variables can be combined with ordinary text and slashes/Hyphen-Combined with symbols, they can create various URL structures.

Let's look at some common examples of custom URL rules for article detail pages:

  1. Simple ID pattern:archive===/{id}.html

    • Example URL:/123.html
    • Description: The simplest URL, directly using the article ID as the unique identifier.
  2. Module + custom filename pattern:archive==/{module}/{filename}.html

    • Example URL:/article/anqicms-pseudo-static-guide.html
    • Description: Highly recommended pattern.{module}can bearticleorproductAnd so on, {filename}This is the custom alias you carefully set for the article. This mode can reflect the content type and also include keywords in the URL, which is very friendly to SEO and user understanding.
      • Hint:Don't forget to set the "URL alias" for your model in the "Content Management" -> "Content Model" and fill in the "Custom URL" in the article editing interface.
  3. Category + Custom Filename Pattern:archive==/{catname}/{filename}.html

    • Example URL:/news/anqicms-latest-update.html
    • Description: Organize URLs through category aliases for clearer hierarchy.
      • Hint:Make sure that each category has a custom URL set in “Content Management”->“Document Category”.
  4. Module+Category+Custom filename pattern:archive==/{module}/{catname}/{filename}.html

    • Example URL:/article/web-design/anqicms-template-dev.html
    • Description: A more detailed hierarchical structure, suitable for websites with complex content classification.
  5. Category+ID pattern:archive==/{catname}/{id}.html

    • Example URL:/tutorials/123.html
    • Description: Combines the semantics of categories with the conciseness of IDs.

Choose which rule to use, as it mainly depends on the structure of your website content and SEO strategy. Generally speaking, an ideal choice is a URL that contains keywords and has an appropriate level of hierarchy.

Implement and test: Ensure everything is in place

After configuring the custom rewrite rules, the following steps need to be taken to ensure they work properly:

  1. Save configuration and update cache:Click Save on the pseudo-static rule setting page, and then be sure to click the bottom of the left menu in the background“Update Cache”. This is a critical step to apply the new settings in AnQiCMS
  2. Check the front-end URL:Open the browser, visit a few article detail pages, and see if the URL has been displayed according to the new rules. If a 404 error occurs, please check if there is an error in your rule syntax.
  3. Configure 301 redirect (for old websites):If your website has been online and indexed by search engines for a while, it is strongly recommended to use the built-in "301 Redirect Management" feature of AnQiCMS.Redirect the old URL to the new URL, which can effectively prevent SEO weight loss and user access interruption caused by URL changes.

Frequently Asked Questions (FAQ)

Q1: Will the old URL automatically redirect to the new URL after modifying the pseudo-static rules?A1: AnQiCMS does not automatically generate 301 redirects for all old URLs.If you modify the URL rule of the page that has already been indexed, in order to avoid SEO loss, you need to manually add 301 redirect rules under "Function Management" -> "301 Redirect Management" to point the old URL to the new URL.

Q2: Why did I set{filename}, but the URL of the article detail page still shows ID?A2: Please check the following points:

1.  你是否在“伪静态规则”中选择了“自定义模式”,并且 `archive` 规则中确实包含了 `{filename}` 变量?
2.  你是否在文章编辑页面的“自定义URL”字段中填写了内容?如果留空,系统将无法生成 `filename`。
3.  保存规则后是否点击了“更新缓存”?

Q3:{module}/{catname}and{filename}What are the differences between these variables?A3: They are all used to provide semantic information in URLs, but have different origins and scope:

*   **`{module}`: