As an experienced CMS website operation personnel, I know that a clear and efficient rule of pseudo-static is crucial for the SEO performance and user experience of the website.The Auto CMS provides powerful pseudo-static features, allowing us to highly customize the URL structure according to actual needs.{page}auto 的正确使用方式。

auto CMS伪静态规则及其重要性

The pseudo-static (URL rewrite) is a technique that converts dynamically generated URLs into more readable and SEO-friendly static URL forms.In AnQi CMS, the pseudo-static feature can help us build URLs that are logically clear, easy to remember and share. This not only benefits the search engine's crawling and ranking, but also enhances users' trust and ease of use of the website.The Anqi CMS provides various built-in static rules for selection, and also opens up the configuration of custom static rules to meet more personalized needs.

在自定义规则中,我们会用到一系列预设的变量,如{id}(Data ID),{filename}(Data custom link name),{catname}(分类自定义链接名)、{catid}(Category ID),{module}(Model table name)et al. While for the pagination handling of the list page, AnQi CMS introduces a special variable:{page}.

Understanding the pagination page number variable{page}function

In website operation, content lists are usually divided into multiple pages to display to avoid a single page's content being too long, which can affect loading speed and reading experience.When the user clicks "Next Page" or jumps to a specific page number, the URL should clearly reflect the current pagination state.{page}Variables are born for this, they represent the page number of the list page.

Integrate correctly into the pseudo-static rules{page}A variable that ensures each pagination has an independent and semantic URL. For example, the second page of an article list might have a URL starting with/article/list.htmlChanges to/article/list-2.html, or/article/list/page-2This depends on the rules we define.This clear URL structure is crucial for search engines to understand the depth and navigation structure of a website, and it also helps users determine their position through the URL.

Using correctly{page}The syntax and practice of variables

Auto CMS in custom pseudo-static rules{page}variable usage has specific syntax requirements. The core is,{page}the variable must be enclosed in a pair of parentheses, for example(-{page})This design is for flexibility, making the page number part optional. This means that when on the first page of the list, the page number information can be omitted from the URL (for example/article/list.html),and from the second page, the page number information will explicitly appear in the URL (for example/article/list-2.html).

The following are some common scenarios where using{page}is an example of a pseudo-static rule for variables:

  • Category list page pagination: When setting up a pseudo-static rule for a list page of a certain content category and supporting pagination, you can use a configuration similar to the following:category===/{module}/{catname}(-{page}).htmlIn this example,{catname}Represents the custom link name for categories. When browsing the first page, the URL may look like/article/news.htmlWhen browsing the second page, the URL will change to/article/news-2.html.

  • Tag list page pagination: For the list page content filtered by a specific tag, the pagination rules can be defined as follows:tag===/tag/{tagname}(-{page}).htmlOr, if the rule is based on Tag ID:tag===/tag-{id}(-{page})Here, the URL on the first page might be/tag/seo.htmlor/tag-1.htmland the second page will be/tag/seo-2.htmlor/tag-1-2.html.

  • pagination for the home page or other model list page: Although the document mainly targetscategoryandtagexamples were provided, but{page}Variables also apply to other lists that support pagination. For example, if your website has a general article list homepage and requires pagination, the rules may be similar to: archiveIndex===/articles(-{page}).htmlSo, the second page of the article's homepage might be/articles-2.html.

It should be emphasized that the brackets(-{page})include the content within, as well as the dashes, can be guaranteed to be{page}The variable is adjusted under the condition of being enclosed. For example, you can also write(page/{page})to generate/article/news/page/2such URL, but make sure it is consistent with your overall URL design. The key is{page}Identified as a pagination variable, and its wrapping structure allows omitting this part when the first page is used.

After configuration, please make sure to save in the background pseudo-static rule management interface, and perform detailed testing on the front-end list pages of the website, to ensure that pagination links can be generated and accessed correctly, and no 404 errors occur.

Summary

{page}The variable is the key to handling list pagination in the Anqi CMS custom pseudo-static rules. By placing it in parentheses(-{page})We can create pagination URLs that are both aesthetically pleasing and have SEO advantages, while ensuring that the URL of the first page is simple and does not have a page number suffix.The reasonable rule of pseudo-static not only enhances the professionalism of the website, but also provides a more friendly access experience for search engines and users.


Common Questions (FAQ)

1. If I forget to add it in the custom pseudo-static rules(-{page})Will the pagination function be affected?If your list page supports pagination but the corresponding pseudo-static rules do not include(-{page})Variables, when the user accesses the second page or later pages, the system will be unable to generate the correct pseudo-static URL.This may cause these pagination pages to be inaccessible (for example, a 404 error occurs), or even if they can be accessed, their URLs may be in dynamic parameter form, thus losing the SEO advantage of pseudo-static.

2. Besides(-{page})Can I use/page/{page}/this format to represent pagination?It is possible. The pseudo-static rules of AnQi CMS allow you to{page}customize the external wrapping structure of variables. For example, it is okay to(-{page})with(page-{page})or(/page/{page})All of them are okay. The key is{page}The variable itself is recognized, and the optional part it is in can be parsed correctly. But please note that regardless of the form, make sure it matches the pagination tag in your template.pagination)Generated link format matches, and thorough testing is performed after configuration.

3. In custom rewrite rules,{page}When does the value of the variable take effect, will the URL of the first page include it? {page}The value of the variable usually takes effect from 2, indicating the second page. When your list is on the first page,(-{page})The special design ensures that page number information is not included in the URL. For example, if the rule iscategory===/{module}/{catname}(-{page}).html, the URL for the first page would be/article/news.html, and the URL for the second page would be/article/news-2.htmlThis design makes the URL of the first page of the home page or category list more concise and avoids redundancy./article/news-1.htmlFormat.