In website operation, a clean and readable URL structure is crucial for search engine optimization (SEO).A pseudo-static URL, as the name implies, refers to those URLs that look like static HTML pages but are actually generated by backend dynamic programs.This URL can retain the flexibility of dynamic content management, provide a friendly crawling path for search engines, and also improve user experience, making it easier for them to understand the content of the page.

AnQiCMS (AnQiCMS) took SEO needs into full consideration from the very beginning of its design, built-in powerful pseudo-static functions, and provided flexible configuration options, allowing us to easily set the most suitable URL structure for the article detail pages.By optimizing these links, our website content can be better indexed by search engines, thereby achieving higher rankings and more natural traffic.

The advantages of pseudo-static in Anqi CMS

Our company's CMS provides excellent support for pseudo-static, which is not just about providing a beautiful URL.It allows us to optimize URL structure through configuration of pseudo-static rules, combined with 301 redirect management, which can effectively improve SEO results.At the same time, Anqi CMS also provides other advanced SEO tools, such as Sitemap generation, keyword library management, anchor text settings, etc., which, together with the pseudo-static function, constitute a complete SEO optimization system, helping our website to stand out in search engines.

Practical configuration of pseudo-static: Step by step

Let's understand step by step how to set up pseudo-static URL structure for article detail pages in Anqi CMS.

Step 1: Understand the pseudo-static mode of Anqi CMS

First, we need to enter the Anqi CMS backend management interface, find the "Function ManagementHere, you will see that Anqi CMS provides several built-in static rule patterns, such as 'number mode', 'model naming mode', etc., which are designed to meet the common needs of different websites.

But in order to achieve a more personalized and SEO-friendly URL structure, we usually choose the 'custom mode'.The custom mode gives us great flexibility, allowing us to design URLs based on our own content features and SEO strategies, which is the key to improving the SEO effect of the article detail page.

Step 2: Choose or customize the URL structure

On the page configuration for pseudo-static rules, after selecting 'Custom Mode', you will see that you can set corresponding rules for different page types.For the article detail page, we mainly focus on the 'archive' rule.

Each rule follows the format "rule name===rule value". Among them,archiveThe 'rule value' is the place where we define the URL structure of the article detail page. Anqi CMS provides several useful variables to help us build SEO-friendly URLs:

  • {id}: The unique ID of the article.
  • {filename}: The custom link name of the article, which we can manually set while editing the article and is the core part carrying keywords in the URL.
  • {catname}Custom link name of the category the article belongs to.
  • {module}URL alias of the model the article belongs to (e.g., 'article' or 'product').

We can combine these variables to create a URL structure that conforms to SEO** practices. Here are some common, SEO-friendly article detail page URL examples:

  • archive===/{module}/{filename}.htmlThis structure is concise and clear, directly reflecting the model type and article keywords in the URL, which is very conducive to search engines understanding the content of the page.
    • For example:http://yourdomain.com/article/anqicms-seo-guide.html
  • archive===/{module}/{catname}/{filename}.htmlIf your website content has a deep hierarchy and you want the URL to reflect the category structure, you can use this method.
    • For example:http://yourdomain.com/article/cms-tutorials/anqicms-seo-guide.html
  • archive===/detail/{id}.htmlThis is a concise mode based on ID, although it does not contain keywords, it is also suitable for some content that does not need to highlight keywords.
    • For example:http://yourdomain.com/detail/123.html

It is recommended to prioritize the selection of the following.{filename}The structure of a variable, as it allows us to incorporate the article title or core keywords into the URL, greatly enhances the semanticization of the URL.After selecting the appropriate structure, remember to click save so that AnQi CMS can apply these new rules.

Step 3: Backend server configuration (for Nginx)

The AnQiCMS internally will process requests based on the pseudo-static rules we set, but before that, the external web server (such as Nginx or Apache) needs to correctly forward all requests to these pseudo-static URLs to the AnQiCMS application for processing.If this step is not configured correctly, even if the security rules of the Anqi CMS are set internally, the page may not be accessible normally.

For example, with Nginx, you need to configure your Nginx configuration file (usually the website'sserverWithin the block), add or modify the following configuration to ensure that all non-static file requests are forwarded to the port where Anqi CMS is running (default is 8001):

location @AnqiCMS {
    proxy_pass http://127.0.0.1:8001; # 这里填写AnQiCMS实际监听的端口
    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
}
error_page 404 =200  @AnqiCMS; # 确保404页面也能被AnQiCMS处理,以便实现内部路由
location / {
   try_files $uri $uri/index.html @AnQiCMS; # 尝试查找静态文件,找不到则转发给AnQiCMS
}

The meaning of this configuration is: First, try to find out whether the requested URI corresponds to an actual file or directory in the file system; if not found, forward the request to@AnqiCMSwhile@AnqiCMSThe request will be proxied to the port of the AnQi CMS application.Please make sure to modify the port according to the actual deployment port of your AnQi CMS.proxy_passof the port number.After the configuration is complete, don't forget to restart the Nginx service to make it effective.

Step 4: Customize the article URL alias (filename)

Used in pseudo-static rules.{filename}After the variable, we still need to set a specific one for each article when publishing or editing posts