As an experienced website operations expert, I fully understand the confusion and anxiety you may feel when the custom URL alias you carefully set up does not work as expected.A clean, meaningful URL structure is crucial for a website's SEO performance and user experience.AnQiCMS was designed with flexibility in URL and SEO-friendliness in mind, but to make these features work, we do indeed need to ensure that the configuration of several key paths is correct.

Today, let's delve deeper into the aspects you should check when customizing the URL alias “**”.

Understand the URL operation mechanism of Anqi CMS.

Firstly, we need to have a clear understanding of how AnQi CMS handles URLs.In AnQi CMS, what we refer to as 'custom URL alias' usually refers to the 'custom URL' field that you manually fill in when editing content (such as articles, categories, single pages, or tags), or the 'URL alias' defined in the content model.about-usorproduct-category-shoesIt represents the unique identifier of your content in the URL.

However, simply setting this alias is not enough.The AnQi CMS adopts the "pseudo-staticThe alias setting of the content itself/Configuration of the pseudo-static rules in the AnQi CMS backendas well asYour web server (such as Nginx or Apache) rewrite rulesThese three levels.

First level check: the content alias setting inside the security CMS

Let's start from the Anqie CMS backend and check the content related to custom URL aliases one by one:

  1. Check if the content type supports custom aliases and the correctness of the aliases:

    • Document (article/product)In the "Add/Edit DocumentMake sure you have entered the alias you want here.Anqi CMS will automatically generate a pinyin alias based on the title, but you can manually modify it.{filename}This variable is set, the custom URL will take effect.
    • Document CategoryIn the "Add/Edit Category" page, there is also a "Custom URL" field. The alias entered here needs to use the pseudo-static rules to take effect.{catname}The variable can take effect.
    • single page: Similar to the document, the single-page also has a "custom URL" field, it is also necessary{filename}Variable.
    • Document Tag: When adding/editing document tags, you can also set a "custom URL", it is also necessary{filename}Variable.
    • Content modelIn the 'Content Model Usage Help' it is mentioned that the model itself also has a 'URL Alias' field, which only supports lowercase English letters and corresponds to the static rule.{module}variable. You need to ensure that all custom aliases comply with their respective input specifications (for example, model aliases can only be lowercase English letters, while custom URLs for documents, categories, and tags can be pinyin or phrases you define).
  2. Ensure the uniqueness of the alias: Anqi CMS emphasizes, 'The custom URL must ensure the uniqueness of the entire site.'If the alias you enter is duplicated with existing content, the system will automatically add a random number at the end to ensure its uniqueness.If you find that there are strange numbers added to the end of your alias, it is very likely that the alias you entered has been occupied.

  3. Check the use of the alias in URL rulesmy-great-articleBut the pseudo-static rules arearchive===/{module}/{id}.html(That is, if you only use module aliases and IDs), then your custom alias will not take effect, and the URL will still be/article/123.htmlin this form.

The second level check: The pseudo-static rule configuration of Anqi CMS backend

The Anqi CMS provides powerful static rule management functionality, which is a key link between your custom alias and the final URL format.

  1. Navigate to the static rule management pageIn Anq CMS backend, find the "Function Management" menu and click on "Static Rule".

  2. Understand the selection of static mode:

    • Built-in modeThe system provides various built-in rules such as "Number Pattern", "Model Naming Pattern", "Category Naming Pattern 1", "Category Naming Pattern 2", and so on. If you currently select the "Number Pattern" (for example,archive===/{id}.htmlIt is clear that custom aliases for documents, categories, and other content will not be used as they are not included in the rules.{filename}or{catname}They will not be used because they are not included in the rules.
    • Custom patternsThis is the most flexible but also most delicate configuration mode. If you want to make full use of custom aliases, you are likely to choose the "Custom mode".
  3. Rule configuration under the custom mode:

    • Check rule variablesIn the custom mode, you need to carefully check each rule (such asarchive/category/page/tagetc.) to see if it contains the alias variable you want to use.
      • To make the custom URL alias of documents, single pages, and tags take effect, the rule value you must include must contain{filename}a variable. For example,archive===/{module}/{filename}.html.
      • To make the custom URL alias of the category effective, the rule value you must include must contain{catname}a variable. For example,category===/{module}/{catname}.html.
      • To make the URL alias of the content model effective, the rule value you need to include must contain{module}Variable.
    • Rule matchingPlease note the structure of the rule. If your rule isarchive===/{module}-{id}.htmlThen the system will always use the content ID to build the URL, rather than the alias you enter in the 'Custom URL' field. Only when the rule explicitly includes{filename}or{catname}At that time, your custom alias will be applied.
    • Save and update cacheAfter completing the modification of the static rules, be sure to click the 'Save' button.Then, go to the "Update Cache" feature in the background, clear all the cache, and make sure that the new rules can be loaded and applied correctly by the system.

Third level check: Rewrite configuration of Web server (Nginx/Apache)

Even if the internal configuration of Anqicms is correct, if your web server does not correctly rewrite external requests to the entry of Anqicms, you will still encounter a "404 Not Found" error when accessing the custom URL.

The AnqiCMS is an independent application developed in Go language, which usually runs on a specific port (default 8001) and is reverse proxied by a web server.This means that your Nginx or Apache needs to configure the corresponding rewrite rules to forward all requests for your domain (especially those that do not directly correspond to static files) to AnQiCMS processing.

  1. Check Nginx configuration:
    • Site configuration file: Locate your Nginx site configuration file (usually located in/etc/nginx/conf.d/or/etc/nginx/sites-available/in the directory).
    • Running directory: Make surerootThe directive points to the AnQiCMS installation directory under thepublicfolder (for exampleroot /www/wwwroot/anqicms.com/public;)