The importance of URL structure in website operation is self-evident.A clear, concise, and keyword-rich URL not only enhances user experience, making it easier for users to remember and share content, but also significantly optimizes the crawling and ranking effects of search engines.AnQi CMS knows this and therefore provides a flexible and powerful pseudo-static rule configuration feature to help users create more SEO-friendly content URL displays.

What is a pseudo-static URL and its importance?

So-called pseudo-static pages are not truly static pages, but rather refer to the use of server URL rewriting technology to convert dynamic page addresses (such asexample.com/article.php?id=123Converted to look like a static page address (for exampleexample.com/article/123.htmlorexample.com/web-seo-strategy.html).

This URL format has multiple benefits for SEO:

  1. Enhance user experience:Users can get a general understanding of the page content through the URL, making it easier to understand and trust.
  2. Enhance search engine friendliness:Search engines prefer URLs with clear structure and explicit paths, which help understand the page hierarchy and content themes.
  3. Keyword integration:Core keywords can be naturally integrated into the URL to further enhance relevance.
  4. Improve Click-Through Rate:A clear URL in search results may attract more user clicks.

The pseudo-static feature of AnQi CMS is exactly to enable these advantages for your website.

The pseudo-static rule options provided by AnQi CMS

AnQi CMS provides built-in pseudo-static rules for users to quickly enable. You can go to the background to view.“Function Management”【en】modulePseudo-static rulesoptions, and you will see several preset modes after entering.

  • Digital Mode:The ID of the main content is used as an identifier in URLs, for example,/article/123.html. This pattern is concise and clear, suitable for Chinese websites.
  • Model Naming Pattern:The URL will include aliases of content models (such as articles, products) and the ID or custom name of the content, for example/article-123.htmlor/news/seo-guide.html. It is more semantically meaningful, suitable for English or websites with higher SEO requirements.
  • Category Naming Pattern 1/2:These two patterns add category aliases to the URL, further refining the URL structure, for example,/news/web-design/seo-guide.html. This helps to clarify the hierarchical relationship of the content.

These built-in patterns usually meet the needs in most cases. But if you have more personalized and refined control requirements for the URL structure, the SafeCMS's“custom pattern”It provides great flexibility.

Deeply customize the rewrite rule configuration

To start configuring custom rewrite rules, please log in to the Anqi CMS backend, navigate to“Function Management”underPseudo-static rulesHere, you will see a name as“custom pattern”The options, click to select and start your personalized configuration.

Custom patterns can be set for six groups of pseudo-static rules, each corresponding to different types of pages: document details, document list, model homepage, single page, tag list, and tag details. Each rule consists of规则名===规则值Two parts make up.

Rule name and corresponding page type:

  • archive: Document detail page (such as articles, product details)
  • category: Document list page (such as category pages)
  • archiveIndex【en】:: Model homepage (such as article center, product center homepage)
  • page【en】:: Single page (such as about us, contact information page)
  • tagIndex【en】:: Tag homepage (such as list page of all tags)
  • tagLabel detail page (such as content list under a specific label)

Available variables in the rule value:

When defining rule values, you can flexibly use a series of predefined variables, which are enclosed in curly brackets{}wrapped:

  • {id}【en】The unique ID of the content.
  • {filename}The custom URL alias for content (document, single page, tag) is usually the pinyin or English title of the content.
  • {catname}【en】The custom URL alias of the category.
  • {catid}The unique ID of the category.
  • {module}The URL alias for the content model (such as article, product).
  • {page}Page number.Please note,{page}Variables must be enclosed in parentheses.()For example, encapsulate.(-{page})It indicates that this is an optional pagination parameter with a prefix.

Actual configuration example and parsing:

Let's look at a specific example of a custom rule:

archive===/{module}-{id}.html
category===/{module}-{catname}(-{page})
archiveIndex===/{module}.html
page===/{filename}.html
tagIndex===/tags(-{page})
tag===/tag-{id}(-{page})
  • archive===/{module}-{id}.html

    • archiveThis rule applies to all:Document details page.
    • /{module}: It indicates that the URL starts with/, followed by the content model's URL alias (for examplearticle/product).
    • -: A delimiter.}
    • {id}.htmlThe ID of the content, followed by.htmlas the file extension.
    • Effect example: /article-123.html//product-456.html.
  • category===/{module}-{catname}(-{page})

    • categoryThis rule applies to all:Document List Page(category page).
    • /{module}-{catname}: It indicates that the URL starts with/Starting with, followed by the URL alias of the content model and the custom alias of the category.
    • (-{page})Means that if there is pagination, it will be added-1/-2suffixes of page numbers; if there is no pagination, this part will not be displayed.
    • Effect example: /article-news///product-electronics-2/.

Important reminder: filling in the custom URL field

In order to{filename}or{catname}Such variables take effect. You need to enable them when editing articles, categories, single pages, and tags in the background.Custom URLEnter the alias you expect in the field. Anqi CMS usually generates pinyin aliases automatically based on the title, but you can manually modify it to ensure SEO-friendliness and uniqueness of the URL.

  • Uniqueness:)Please pay special attention to,{filename}and{catname}the value must be unique across the entire site. Otherwise, the system will automatically add random numbers at the end to ensure its uniqueness.
  • Consistency:Suggest using a unified naming convention, such as all lowercase and using hyphens.-Separate words, avoid special characters and Chinese.

Server environment configuration (Nginx/Apache)%

After setting up the pseudo-static rules for the Aiqi CMS backend, this is just the first step.To make these rules truly effective on your website, you also need to make the corresponding configuration on your web server (such as Nginx or Apache).The AnQi CMS is essentially a Go language application, which usually provides services through reverse proxy.

Nginx server configuration example:

In the Nginx site configuration file, you need to ensure that Nginx can correctly forward pseudo-static requests to the Anqi CMS for processing. Here is a typical Nginx configuration snippet:

`nginx server {

listen       80;
server_name yourdomain.com; # 替换为您的域名
root /www/wwwroot/anqicms.com/public; # 替换为您的网站根目录/public

location @AnqiCMS {
    proxy_pass http://127.0.0.1:8001; # 这里的端口8001是安企CMS默认监听的端口,如果修改过请对应修改
    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_