The importance of link structure in website operation is self-evident.A clear and meaningful URL not only enhances user experience, but also makes it easier for visitors to understand the content of the page, and is a key factor in search engine optimization (SEO).Cluttered, dynamic URLs with a large number of parameters often make it difficult for search engine spiders to crawl and are not conducive to keyword weight transfer.Therefore, converting dynamic URLs to static forms is a common choice in modern website construction.

AnQiCMS (AnQiCMS) understands this point, built-in powerful static URL configuration function, allowing you to flexibly define the link display structure of website content, thereby better serving SEO and user experience.

Why are Static URLs so Important?

Static page, as the name implies, it is still dynamically generated on the server side, but it appears as a static page in the URL address bar, for example, with.htmlending. Compared with having?id=123&category=abcThis kind of dynamic URL, pseudo-static URL has many advantages:

  • Improve SEO effectiveness: Search engines prefer concise, keyword-containing static URLs.The static link is easier for search engine spiders to crawl and index, and the keywords embedded in the link also help to improve the search ranking of the relevant page.
  • Improve user experience: A semantic URL, such as/news/anqicms-update-log.html,比/article.php?id=456Easier to understand and remember. Users can also have a more intuitive understanding of the content linked when sharing or revisiting.
  • Enhance the professionalism of the websiteA clear URL structure gives a professional and reliable impression, helping to establish user trust in the website.

The journey of pseudo-static configuration in AnQi CMS

In AnQiCMS, configuring the pseudo-static URL rules is a relatively intuitive process. You can find it in the “function management”module in the back end.Static rules” option.

1. Built-in pseudo-static mode: Get started quickly

To make it convenient for users, AnQiCMS provides four preset static URL modes that can meet the needs of most websites. These modes cover common URL structures, and you can apply one of them after selection and saving:

  • Numeric pattern: Usually adopted/{模块别名}-{ID}.htmlThe form, for example/article-123.html. This pattern is concise and clear, suitable for Chinese sites that pay attention to ID recognition.
  • Model naming pattern: The URL will include aliases of models (such as articles, products), for example/news/anqicms-update-log.html. Commonly used on English websites to highlight the model of the content.
  • Category naming pattern 1 & category naming pattern 2These patterns emphasize the category alias in URLs, and can be constructed into such as/technology/anqicms-features.htmlThis structure, choose based on your preference for Chinese or English sites.

These built-in patterns generally work well in most cases, allowing you to enjoy the benefits of pseudo-static without needing to understand the rule writing in detail.

2. Custom mode: Fine-grained control of link structure

If you have more personalized needs for built-in modes or want to create a unique URL structure, AnQiCMS'Custom patternsThis will be your **choice. It is an advanced feature that allows you to build links that fit your website's content positioning and SEO strategy through flexible variable combinations.

Please note the important reminder:The configuration of a custom mode needs to be very strict, any incorrect rule may cause the page to be inaccessible. After modification and saving, please make sure to thoroughly test all pages of the website.

In custom mode, you will be faced with six core static rules, each corresponding to different types of pages:

  • archive: is used for document detail pages (such as articles, product details).
  • categoryUsed for the category list page.
  • archive indexUsed for the model home page (such as the article list home page).
  • pageUsed for single page detail pages (such as About Us, Contact Information).
  • tag indexUsed for tag homepage.
  • tagUsed for the tag detail page.

Each rule is followed规则名===规则值The format. In the "Rule Value", you can flexibly use various variables provided by AnQiCMS to construct the URL:

  • {id}: Data ID, such as article ID, category ID.
  • {filename}: Custom link name for the data (such as the alias of a document, a single page alias, or a Tag alias).
  • {catname}Custom link name for category.
  • {catid}: Category ID.
  • {module}: Model table name or URL alias (configurable in the background content model).
  • {page}: Page number. It should be noted that the pagination variable{page}must be enclosed in parentheses, for example(-{page})is optional, and pagination will be displayed only when the page number is greater than 1.

Custom rule example:

Let us understand how to combine these variables through several common scenarios:

  1. Document details page (archive)

    • Requirement:The article link should include the model alias and article ID, such as/news/123.html.
      
      archive===/{module}/{id}.html
      
    • Requirement:I hope the article link includes the model alias and a custom filename, such as/news/anqicms-features.html.
      
      archive===/{module}/{filename}.html
      
      Here{filename}Originates from the 'Custom URL' field you filled in when adding a document. AnQiCMS will automatically generate a pinyin alias based on the document title, and you can also manually modify it.
    • Requirement:Hope the product detail page link includes the product model alias, category alias, and product ID, such as/products/electronics/tv-001.html.
      
      archive===/{module}/{catname}/{filename}-{id}.html
      
  2. Category list page (category)

    • Requirement:I hope the category link includes the model alias and category ID, such as/article/category/45.html.
      
      category===/{module}/category/{id}.html
      
    • Requirement:I hope the category link includes the model alias and custom category name, and supports pagination, such as/article/web-design(-{page}).html.
      
      category===/{module}/{catname}(-{page}).html
      
      Here{catname}Originating from the 'Custom URL' field you filled in the 'Document Category'.
  3. Single page detail page (page)

    • Requirement:I hope the single page link uses the custom filename directly, such as/about-us.html.
      
      page===/{filename}.html
      
      Here{filename}The value comes from the 'Custom URL' field you filled in the 'Page Management'.
  4. Tag detail page (tag)

    • Requirement:Hope the tag link includes an ID and supports pagination, such as/tag/123(-{page}).html.
      
      tag===/tag/{id}(-{page}).html
      
    • Requirement:I hope the tag link includes a custom tag name and supports pagination, such as/tags/website-security(-{page}).html.
      
      tag===/tags/{filename}(-{page}).html
      
      Here{filename}Originates from the "Custom URL" field filled in the "Document Tags".

When configuring these custom URLs, please make sure that the corresponding 'custom URL' fields are reasonably filled in the 'Content Management' interface under 'Publish Documents', 'Document Categories', and 'Document Tags', etc. The values of these fields will directly affect the static rules in the pseudo static rules.{filename}and{catname}The output of the variable.

Test and maintenance after configuration

No matter which pseudo-static you choose