As an experienced CMS website operation personnel, I know 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 Page(tagThe configuration of this, we can adjust it finely 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 pseudo-static rules of AnQi CMS allow us to convert dynamically generated URLs into more readable and SEO-friendly static URL formats.The system is built-in with several default rules, such as number pattern, model naming pattern, and classification naming pattern, which can meet most common needs.However, for pages like tabs that require high customization or follow specific SEO strategies, custom patterns of pseudo-static rules offer unparalleled flexibility.

The configuration entry for pseudo-static rules is located under the 'Function Management' menu in the Anqi CMS backend, select 'Pseudo-Static Rules' to enter the configuration interface.Here, we can choose the system predefined rules, or switch to 'Custom Mode' to manually edit the URL structure of each page type.规则名===规则值is defined in the form, and provides a series of variables for us to combine, such as{id}(Data ID),{filename}(Data custom link name),{page}(Page number) etc.

Configure the tag list page (tagIndex) pseudo-static rules

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

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

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 start with/tags.
  • (-{page})This is an optional pagination variable. When the tag list page has multiple pages, for example, the second page, the URL will become/tags-2If there is only one page, or if it is the first page, the URL will not contain-1or-0.

According to your SEO strategy and user habits, you can modifytagsThis 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/2, then 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 the habits of some blogs or portal websites.It is important to ensure the uniqueness and readability of the rules, and to maintain consistency with the overall URL structure of your website.After saving the rule, please make sure to clear the system cache and test on the front-end page to ensure that all tag list page URLs can be generated and accessed correctly.

Configure tag detail page (tag) pseudo-static rules

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 totag/list.htmltemplates.

In custom mode,tagThe default rule example on 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 label. For example, a label with ID 10 might have a URL like this:/tag-10.html.
  • (-{page}): withtagIndexSimilar, this is an optional pagination variable, when the documents under the tag have multiple pages, the URL will contain pagination information, such as/tag-10-2.html.

However, using only the ID as the URL for the detail page is not ideal for SEO because the ID lacks 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').{filename}), we can use it in pseudo-static rules{filename}Generate more descriptive URLs with variables.

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 something like/tag/anqicms-tutorial.htmlor/tag/seo-optimization/2.htmlThe URL. This method combines readability and pagination support.

  2. A more concise custom URL (removing)tagthe prefix): 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 article or category{filename}Rule conflicts, therefore be cautious when configuring to ensure the uniqueness of URLs and avoid rewrite issues.

Important variable explanation:

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

Please make sure to save the rule after configuration and execute the "Update Cache" operation.[en] Then, go to the website's frontend, click on different tabs and pagination links, and verify that the URL is generated as expected and can be accessed normally.

Implementation suggestions and precautions

  • Principle of Uniqueness:Whether it istagIndexOrtagThe rules, all should ensure that the generated URL has uniqueness throughout the entire website.Avoid URL conflicts with other content (such as articles, single pages, categories), otherwise it may cause the page to be inaccessible or content to be displayed incorrectly.
  • SEO-friendly:As far as possible in{filename}Use English words or pinyin related to the tag 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.To avoid traffic loss and SEO negative impact, it is essential to utilize the 301 redirect function of Anqi CMS and permanently redirect the old URL to the new URL.
  • template corresponding to:Ensure that the template directory exists in yourtag/index.html(corresponding)tagIndex) andtag/list.html(corresponding)tag) File, and these template files can be correctly calledtagList/tagDetailandtagDataListtags to render page content.

By following the 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 enhancing the website's SEO performance and user experience.


Common Questions (FAQ)

1. Will the search engine recognize the new URL after I modified the pseudo-static rules of the tab page? Will my old links become invalid?

Yes, the search engine will eventually recognize and index new URLs.However, this process takes time.After you modify the pseudostatic rules, the old URL links will indeed become invalid, and users and search engines will not be able to access these old links directly.To avoid traffic loss and SEO weight decrease, it is strongly recommended that you use the '301 Redirect Management' feature on the AnQiCMS backend immediately after modifying the rules, and redirect all old page URLS in bulk to the new URLs.So, the search engine will understand that this is a permanent URL change, transferring the weight of the old URL to the new URL, and allowing users to access it seamlessly.

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

It is absolutely possible. AnQiCMS supports setting a 'custom URL alias' for each tag (usually referred to asslugorfilename) in the configuration of the tag detail page (tag) pseudo-static rules, you can use{filename}Replace with a variable{id}. For example, you can set the rule totag==={filename}(-{page}). The generated URL will be/您的自定义标签名.html(if not configured)/Separator).The URL with a custom name has better readability and SEO-friendliness, but please make sure that each tag's custom name is unique to avoid URL conflicts.

I have configured the tag rewrite rules according to the tutorial, but the front-end tag page still displays a 404 error or style disorder. How should I troubleshoot?

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

  • Clear the cacheFirstly, click on 'Update Cache' in the AnQiCMS background to ensure that the new pseudo-static rules have taken effect. The server and browser caches may also need to be cleared.
  • Check the rule syntaxPlease carefully check the rules you entered in the 'URL Rewrite Rules', ensuring there are no spelling errors, mismatched brackets, or incorrect variable usage.A minor syntax error can cause the rule to fail.
  • Check template file: Confirm that the current template directory exists undertag/index.html(corresponding to the tag list page) andtag/list.htmlThese two files. If the files do not exist or the path is incorrect, the system will not be able to render the page.
  • URL conflictCheck if there are other page type rules (such as articles, categories, single pages) conflicting with the tab page rule, leading to the incorrect parsing of URLs.
  • 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 to forward all requests to AnQiCMS.