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 search engine crawling and ranking effects.AnQi CMS knows this and therefore provides a flexible and powerful static rule configuration function to help users create more SEO-friendly content URL displays.

What is the importance of SEO-friendly URL and its significance?

So-called pseudo-static is not a real static page, but refers to the use of server URL rewriting technology to rewrite the address of dynamically generated pages (such asexample.com/article.php?id=123) into an address that looks like a static page (such asexample.com/article/123.htmlorexample.com/web-seo-strategy.html)

This URL format has multiple benefits for SEO:

  1. Improve user experience:Users can roughly understand the content of the page 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 helps understand the page hierarchy and content theme.
  3. Keyword integration:Can naturally integrate core keywords into URLs, thereby enhancing relevance.
  4. Increase click-through rate:A clear URL in search results may attract more user clicks.

The static function of AnQi CMS is to enable your website to have these advantages.

The static rule options provided by AnQi CMS

AnQi CMS provides built-in pseudo-static rules for users, making it easy to enable quickly. You can go to the background to see the options,“Function Management”the module.“Static Rules”and you will see several preset modes after entering:

  • Numeric mode:The URL primarily uses the ID of the content as an identifier, for example/article/123.htmlThis pattern is concise and clear, suitable for Chinese websites.
  • Model naming pattern:The URL will include the alias and ID or custom name of the content model (such as articles, products), for example/article-123.htmlor/news/seo-guide.html. More semantic, suitable for English or SEO-friendly websites.
  • Categorization naming pattern 1/2:These two patterns add category aliases to URLs, further refining the URL structure, for example./news/web-design/seo-guide.htmlIt helps to clarify the hierarchical relationship of content.

These built-in patterns can meet most needs. But if you have more personalized and fine-grained control requirements for the URL structure, SafeCMS'sCustom ModeIt provides great flexibility.

Deeply customize the static rule configuration

To start configuring the custom static rule, please log in to the Anqi CMS backend and navigate to“Function Management”below“Static Rules”. Here, you will see a name calledCustom ModeThe options, click to select to start your personalized configuration.

Custom mode can set up 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 is created by规则名===规则值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 page)
  • archiveIndex: Model homepage (such as article center, product center homepage)
  • page: Single page (such as 'About Us', 'Contact Us' pages)
  • tagIndex: Tag homepage (such as a list page of all tags)
  • tag: Tag detail page (such as a content list under a specific tag)

Rule values can include variables:

When defining rule values, you can flexibly use a series of predefined variables, enclosed in curly braces:{}Enclosed by:

  • {id}: Unique ID of the content.
  • {filename}The custom URL alias of content (document, single page, tag), usually the pinyin or English title of the content.
  • {catname}Custom URL alias for a category.
  • {catid}Unique ID of the category.
  • {module}URL alias of content model (such as article, product).
  • {page}Page number.Please note,{page}Variables must be enclosed in parentheses.()Enclosed, for example(-{page})This 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

    • archive: This rule applies to allDocument detail page.
    • /{module}Indicates that the URL starts with/Followed by the URL alias of the content model (for examplearticle/product)
    • -: A separator
    • {id}.html: The content ID, followed by.htmlas a file extension.
    • Effect example: /article-123.html//product-456.html.
  • category===/{module}-{catname}(-{page})

    • category: This rule applies to allDocument list page(Category page).
    • /{module}-{catname}Indicates that the URL starts with/Starting, followed by the URL alias of the content model and the custom alias of the category.
    • (-{page}): indicates that pagination will be added if it exists.-1/-2Suffix for page numbers; this part is not displayed if there is no pagination.
    • Effect example: /article-news///product-electronics-2/.

Important reminder: Fill in the custom URL field.

In order to{filename}or{catname}This variable takes effect, you need to do it in the background when editing articles, categories, single pages, and tags"Custom URL"Enter the alias you expect. Anqi CMS usually generates pinyin aliases according to the title, but you can manually modify it to ensure the SEO-friendliness and uniqueness of the URL.

  • Uniqueness:Please pay close attention to,{filename}and{catname}The value must be unique throughout the entire site, otherwise the system will automatically add random numbers at the end to ensure its uniqueness.
  • Consistency:It is recommended to use a uniform naming convention, such as lowercase letters and hyphens-Separate words, avoid special characters and Chinese.

Server environment configuration (Nginx/Apache)

After completing the pseudo-static rule setting of the AnQi CMS backend, this is just the first step.In order for these rules to truly take effect 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 that typically 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. The following 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_