As an experienced AnQi CMS website operations personnel, I am well aware that a clear and efficient URL rewriting rule is crucial for the SEO performance and user experience of a website. AnQi CMS provides great flexibility in URL rewriting management, especially for tag list pages (tagIndex) and tag detail pages(tagThe configuration, we can adjust in detail according to actual needs. Next, I will elaborate on how to configure the pseudo-static rules for these two types of tabs in AnQiCMS.

Deeply understand the pseudo-static rules of Anqi CMS

The AnQi CMS' pseudo-static rules allow us to convert dynamic-generated URLs into more readable and SEO-friendly static URLs.The system has several built-in default rules, such as number patterns, model naming patterns, and category naming patterns, which can meet most common needs.However, for tabs that require high customization or follow specific SEO strategies, custom static rules provide unparalleled flexibility.

The configuration entry for static rules is located under the "Function Management" menu in the AnQi CMS backend, select "Static Rules" to enter the configuration interface.Here, we can choose the system's preset rules, or switch to the 'custom mode' to manually edit the URL structure for each type of page.Each rule is by规则名===规则值defined in the form and provides a series of variables for us to combine, such as{id}(Data ID)、{filename}(Custom data link name)、{page}(pagination page number) and so on.

Configure the tag list page (tagIndexThe pseudo-static rule

The tag list page, usually referred to as the tag homepage, which displays all the tags on the website or displays some tags based on certain filtering conditions (such as the first letter) and usually supports pagination. In AnQiCMS, this page corresponds to thetag/index.htmlTemplate.

To configuretagIndexthe rewrite rules, we need to select "Custom Mode" on the page of "Function Management" > "Rewrite Rules". The system provides a default tagIndexRule example, it is usually in the form of:

tagIndex===/tags(-{page})

The meaning of this rule is:

  • /tags: This is the base URL path of the tag list page. All tag list pages will be in the form of:/tagsAt the beginning.
  • (-{page})This is an optional pagination variable. When the tag list page has multiple pages, such as the second page, the URL will become/tags-2If there is only one page, or it is the first page, the URL will not include-1or-0.

You can modify it based on your SEO strategy and user habitstagsThis word, or adjust the pagination display. For example, if you want the URL of the tag list page to be/all-tagsand the pagination to be displayed as/all-tags/page/2Then you can configure it like this:

tagIndex===/all-tags(/page/{page})

This rule uses/page/{page}As a pagination indicator, make it more in line with some blog or portal site habits.It is important to ensure the uniqueness and parseability of the rules and to keep them consistent with the overall URL structure of your website.After saving the rules, please be sure to clear the system cache and test on the front-end page to ensure that all label list page URLs can be generated and accessed correctly.

Configure tag detail page (tagThe pseudo-static rule

The tag detail page displays all related documents (articles, products, etc.) under a specific tag, and this page usually supports pagination. In AnQiCMS, this page corresponds to thetag/list.htmlTemplate.

In the custom mode,tagThe default rule example for the detail page is usually:

tag===/tag-{id}(-{page})

Let's break down this rule:

  • /tag-: This is the base URL prefix for the tag detail page.
  • {id}This is the unique identifier of the tag. For example, the URL of a tag with ID 10 might be/tag-10.html.
  • (-{page}): withtagIndexSimilar, this is an optional pagination variable, such as when there are multiple pages of documents under the label, the URL will contain pagination information, like/tag-10-2.html.

However, using an ID as the URL for the label detail page is not ideal for SEO, as IDs lack semantic information.The Anqi CMS allows us to set a 'custom URL' for each tag (this option can be seen when editing tags under 'Content Management' -> 'Document Tags').Once a label has been set with a custom URL (i.e.{filename}), we can use it in pseudo-static rules.{filename}Variables to generate more descriptive URLs.

Here are some based on{filename}common configuration examples:

  1. Use tags to customize URLs and optional pagination: tag===/tag/{filename}(-{page})This rule will generate such/tag/anqicms-tutorial.htmlor/tag/seo-optimization/2.htmlThe URL. This method combines readability and pagination support.

  2. A more concise custom URL (remove)tagprefix): tag==={filename}(-{page})If you want a shorter URL, you can directly use the custom URL of the tag, for example/anqicms-tutorial.html. But please note that this may conflict with the{filename}Rule conflicts, therefore, be cautious when configuring to ensure the uniqueness of the URL and avoid rewriting issues.

Important variable description:

  • {id}: The numeric ID of the tag.
  • {filename}: The custom URL alias set in the background (for example,anqicms-tutorial). Make sure that the custom URL is unique and only contains letters, numbers, and underscores, without spaces.
  • {page}Page number.

After configuration is complete, please make sure to save the rules and execute the "Update Cache" operation.Later, go to the website front end, click on different tabs and pagination links, and verify whether the URL is generated according to your expectations and can be accessed normally.

Implementation suggestions and precautions

  • uniqueness principleWhether it istagIndexOrtagThe rules should ensure that the generated URL is unique within the entire site.Avoid URL conflicts with other content (such as articles, single pages, categories) or the page may not be accessible or content may be displayed incorrectly.
  • SEO-friendly: Try to be{filename}Use English words or pinyin related to the label content, avoid using meaningless numbers or random characters.A concise and descriptive URL is more beneficial for search engine crawling and user understanding.
  • 301 RedirectIf you change the pseudo-static rules after the website goes live, the old URL may become invalid.In order to avoid traffic loss and SEO negative impact, it is necessary to make full use of the 301 redirect function of Anqi CMS to permanently redirect the old URL to the new URL.
  • corresponding to the: Ensure that your template directory containstag/index.htmlCorresponding totagIndex), andtag/list.htmlCorresponding totag) files, and that these template files can be called correctlytagList/tagDetailandtagDataListwith tags to render page content.

By following the above detailed configuration steps and注意事项, you can effectively set up pseudo-static rules for the tag list page and tag detail page in Anqi CMS, thereby improving the website's SEO performance and user experience.


Frequently Asked Questions (FAQ)

1. After I modified the pseudo-static rules of the tab page, will the search engine recognize the new URL? Will my old link become invalid?

Yes, the search engine will eventually recognize and index the new URL.However, this process takes time. After you modify the static rules, the old URL links will indeed become invalid, and users and search engines will not be able to directly access these old links.To avoid traffic loss and SEO weight loss, it is strongly recommended that you use the "301 Redirect Management" function in the AnQiCMS background immediately after modifying the rules to batch redirect all old tab page URLs to new URLs.This will make the search engine understand that this is a permanent URL change, and the weight of the old URL will be passed to the new URL, while users can also access it seamlessly.

2. Can the URL of the tag detail page of AnQiCMS not use ID but use a custom name instead (i.e.,{filename})?

Absolutely. AnQiCMS supports setting a "custom URL alias" for each tag (usually calledslugorfilename)。When configuring the pseudo-static rules for thetag) tag detail page,{filename}Replace variables{id}For example, you can set the rule totag==={filename}(-{page})The generated URL will be/您的自定义标签名.html(If not configured/Separator). Using a custom name for the URL has better readability and SEO-friendliness, but please ensure that each tag's custom name is unique to avoid URL conflicts.

3. I have configured the tag pseudo-static rules according to the tutorial, but the front-end tag page still shows a 404 error or style chaos. How should I troubleshoot?

When encountering such problems, you can check from the following aspects:

  • Clear the cacheFirst, click "Update Cache" in the AnQiCMS backend to ensure that the new pseudo-static rules have taken effect. The server and browser caches may also need to be cleared.
  • Check the syntax of the rules: Please carefully check the rules you entered in the "pseudo-static rules", ensuring there are no spelling errors, mismatched brackets, or incorrect variable usage.A minor grammatical error can cause the rule to fail.
  • Check the template file: Confirm that the current template directory existstag/index.html(corresponding to the tag list page) andtag/list.htmlThese two files corresponding to the tag detail page. If the file does not exist or the path is incorrect, the system will not be able to render the page.
  • URL conflictCheck if there are any other page type (such as articles, categories, single pages) static rules conflicting with tab page rules, causing the URL to be incorrectly parsed.
  • Nginx/Apache configurationIf you are manually configuring the server (instead of using tools like Baota panel), please make sure that your Nginx or Apache configuration file contains the correct pseudo-static rewrite rules, and forward all requests to AnQiCMS for processing.