As a senior website operations expert, I know that URL structure is crucial for the search engine optimization (SEO) and user experience (UX) of a website.An clear and semantically structured URL not only helps search engines better understand the content of the page, but also makes it more intuitive and trustworthy for users to visit.In AnQiCMS (AnQi CMS), flexibly configuring the pseudo-static rule is the key to achieving this goal.Today, let's delve into how to configure the pseudo-static rules in AnQiCMS to optimize your website URL structure.

Why are pseudo-static URLs so important?

In the daily operation of the website, we often encounter such problems: dynamic URLs (for example/?id=123&category=news)Because of its many parameters and poor readability, it is often not favored by search engines and users.They look disorganized, difficult to remember and share, and are also prone to make search engines mistakenly believe them to be duplicate content.

Static URLs (for example/news/anqicms-update.htmlThese issues can be effectively resolved.It is identical in form to a real static HTML page, but on the server side, these 'static' requests are mapped to dynamic content through URL rewriting mechanisms.

  1. Improve SEO performance:Search engines prefer concise URLs that contain keywords. Static URLs make it easier for search engines to crawl and index content, and may improve keyword rankings.
  2. Improved user experience:Users can intuitively understand the page content from the URL, for example, seeing/about-us.htmlThey can know it is about the 'About Us' page. This increases trust and is convenient for users to remember and share.
  3. Enhance website security:Hid the backend parameters, reducing the risk of being maliciously exploited.

AnQiCMS as an enterprise-level CMS that focuses on SEO, naturally takes static SEO as one of its core features, providing us with powerful and flexible configuration options.

English overview of AnQiCMS's pseudo-static capabilities

AnQiCMS has built-in features for pseudo-static and 301 redirect management, aimed at helping users improve SEO effects by optimizing URL structure.Under the "Feature Management

Configure pseudo-static: from basic to advanced

AnQiCMS's pseudo-static configuration is divided into two main methods: preset rules and custom rules.

Pre-set rules: Get started easily

For most AnQiCMS users, the four preset static rules provided by the system are already able to meet daily operation needs. These rules are designed very user-friendly, and you can quickly select them according to your website type and target audience:

  1. Digital Mode:The ID of the main content is used as an identifier in URLs, for example,/article/123.htmlThis mode is concise and clear, especially suitable for Chinese sites, as users have a higher acceptance of numeric IDs.
  2. Model Naming Pattern:The URL will include the model name of the content and the custom alias of the content, for example/news/anqicms-update.htmlThis pattern is more semantic, very friendly to English sites or sites that pursue more descriptive URLs, allowing the URL to directly reflect the content theme.
  3. Category naming pattern 1:The URL will include the custom alias of the category name and content, for example/company-news/anqicms-update.html. This pattern is more common on Chinese sites and can clearly show the hierarchical relationship of the content.
  4. Category naming pattern 2:

Selecting a preset rule is very simple, just select the one you prefer in the background, and then save it. AnQiCMS will automatically manage URL rewriting for you.

Custom rules: Fine-grained control

For operators with higher requirements or scenarios with special design needs for website URL structure, AnQiCMS provides a powerful custom rewrite rule function.This belongs to advanced mode, but once you master it, you will be able to fine-tune the URL structure.

In custom mode, you can set independent SEO rules for six different types of pages, which are:

  • Document Details Page (archive)
  • Document List Page (category)
  • Model Home Page (archiveIndex)
  • Single Page (page)
  • Tag List Page (tagIndex)
  • Tag Details Page (tag)

Each custom rule follows规则名===规则值format. In规则值English, You can flexibly use a series of built-in variables to construct a URL:

  • {id}The unique ID of the content.
  • {filename}
  • {catname}The custom URL alias of the category.
  • {catid}The unique ID of the category.
  • {module}: The URL alias of the content model (for example, the article model might bearticle, the product model may beproduct).
  • {page}:Used for pagination page number. It should be noted that the pagination variable must be enclosed in parentheses, for example(/{page}),so that the system can identify it correctly.

An example of a custom rule:

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

In this example:

  • The URL of the article detail page will be/{模型别名}/{内容自定义别名}.htmlfor example/article/anqicms-tutorial.html.
  • The URL of the category list page will be/{模型别名}/list-{分类ID}.htmlIf there are multiple pages, it will be/{模型别名}/list-{分类ID}-2.html.
  • The URL of the single page will be/{自定义别名}.htmlfor example/about-us.html.

Key tips:To make{filename}and{catname}

Save and take effect

No matter which preset rules or custom rules you choose, after saving, AnQiCMS will immediately start using the new URL structure internally.It should be noted that in order to ensure that these pseudo-static URLs can be accessed normally on your website, your server (such as Nginx or Apache) must be properly configured to forward all requests to AnQiCMS for processing, usually through a 'catch-all' or reverse proxy rule.The installation guide of AnQiCMS usually provides these server-side configuration examples in English.

Practice