In website operation, a clear and easy-to-understand URL structure is crucial for search engine optimization (SEO) and user experience.AnQiCMS (AnQiCMS) offers powerful custom URL features, allowing you to flexibly configure links based on content models, categories, articles, etc.However, you may sometimes find that the custom URL set up in the background does not display as expected on the front-end page, or that clicking on it results in a 404 error.When encountering this situation, we can follow the following steps to troubleshoot, gradually locate and solve the problem.


I. Start from the Anqi CMS background configuration.

When the custom URL does not work, we should first check the relevant settings of the Anqie CMS backend, which is the most direct and fundamental troubleshooting step.

  1. Check the basic address settings of the websiteFirst, please go toBackend settingsofGlobal Settingsthe page. Confirm that the "Website Address" field is filled with the correct domain name of your website, for examplehttps://www.yourdomain.comThis address is the basis for generating all internal links by the system, and if it is incorrect, all custom URLs may be affected.

  2. Check the configuration of pseudo-static rulesThe rule of pseudo-static is whether the URL can be displayed in a customized format. Please enterfunction managementofStatic rulesthe page.

    • Select the preset mode:The AnQi CMS has built-in multiple static rules such as 'numeric mode' and 'model naming mode'.First, try to select a preset mode that suits your needs, save it, clear the cache, and then observe the front-end effects.
    • Custom Mode:If the preset mode does not meet your personalized needs, you may have enabled the "custom mode". In this mode, you need to carefully check each rule (such asarchive/category/page/tagIs the configuration correct?
      • Ensure that the variables used in the rules (such as{module}/{id}/{filename}/{catname}/{page}) are spelled correctly and the logic meets your expectations. For example, the rules for article details may look likearchive===/{module}/{filename}.html.
      • Pay special attention to the pagination rules (such as{page}) whether it is contained within parentheses, for example(-{page}), this ensures that the link remains correct when there is no pagination.
    • Save and clear cache:No matter which pseudo-static rule you modify, be sure to click the "Save" button and then go toUpdate CacheFunction, completely clear the system cache to make the new rules take effect.
  3. Check the custom URL field at the content levelAnqi CMS allows you to set independent custom URLs for each article, category, single page, and tag when publishing and editing content.

    • Document, Category, Single Page, Tag:AccessContent ManagementbelowDocument Management/Document Category/Document Tag, as well asPage ResourcesbelowPage ManagementCheck whether the 'custom URL' field is filled in and the format conforms to the pseudo-static rules you have defined while editing each specific content.
    • Uniqueness:The custom URL must be unique throughout the entire site.If a duplicate occurs, the system may automatically add random numbers to the URL to ensure uniqueness, which may result in a URL different from what you expect.
    • Field content:By default, the system will automatically generate a pinyin as the URL alias based on the title (url_tokenField), but you can manually modify it. Please make sure that the manually modified URL contains only letters, numbers, and underscores, and avoid using special symbols or spaces.
  4. Clear the system cacheThis is a very easily overlooked but crucial step. After any modifications to URLs, content publishing, or system settings in the Anqi CMS backend, it is strongly recommended that you go toUpdate CacheFunction, click 'Clear Cache Now'. The system cache may store old URL routing information, and failing to clean up in a timely manner may cause new settings to take effect immediately.


Check server environment configuration

Even if the AnQi CMS backend configuration is correct, if your web server (such as Nginx or Apache) does not cooperate properly, the custom URL will still not work or a 404 error will occur.

  1. Verify reverse proxy settingsThe AnQi CMS is usually deployed through web servers like Nginx or Apache for reverse proxy, forwarding external requests to the AnQi CMS service.

    • Nginx configuration:Check your Nginx configuration file (usually in)/etc/nginx/conf.d/or/www/server/nginx/conf/vhost/directory). Ensureproxy_passPoint to the correct port for running the AnQi CMS (default is)http://127.0.0.1:8001)
    • Apache configuration:If you are using Apache, you also need to confirm that the reverse proxy module is enabled and the target URL is set correctly.The specific configuration can be referred to in the Apache deployment document of Anqi CMS.
  2. Confirm the pseudo-static rules of the Web serverThe server-side pseudo-static rules are the key to making custom URLs effective.It tells Nginx or Apache how to handle a URL that looks like a static file but is actually a dynamically generated page.

    • Example of Nginx pseudo-static rules:
      
      location @AnqiCMS {
          proxy_pass http://127.0.0.1:8001;
          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页面被正确转发
      location / {
         try_files $uri $uri/index.html @AnqiCMS; # 尝试寻找文件,否则转发给AnQiCMS处理
      }
      
      Please confirm that your Nginx configuration includes a rule similar totry_filesanderror_pageand the rule, and