As an experienced CMS website operation personnel for a security company, I know that a high-quality URL structure is crucial for the website's search engine optimization (SEO) and user experience.An clear, meaningful and easy-to-catch URL, which can not only help search engines better understand the page content, but also give users a sense of direction when visiting.AnQiCMS provides great flexibility in setting up pseudo-static rules, especially its custom mode, which allows operators to finely adjust the URL structure according to specific needs.
AnQiCMS伪静态规则的核心价值
The built-in pseudo-static feature of AnQi CMS is designed to convert dynamic URLs to static or pseudo-static URLs, which is crucial for improving the website's SEO performance and user-friendliness.Search engines prefer simplified, keyword-containing static URLs because this helps them better parse and index page content.At the same time, users also find it easier to understand and remember such URLs, thereby improving the overall accessibility of the website.AnQiCMS provides several predefined rewrite rules such as numeric patterns and model naming patterns to meet common application scenarios.However, for operators who pursue ultimate SEO effects and personalized URL design, customizing pseudo-static rules is undoubtedly the key to bringing the powerful functions of AnQiCMS into full play.
开启自定义伪静态规则
To start customizing the pseudo-static rules, we need to enter the "Function Management" module of AnQiCMS backend and then select "Pseudo-static Rules.Here, the system will provide a variety of built-in rules for selection.To enable custom configuration, you need to switch to "Custom Mode".Custom mode allows you to define the URL structure for different page types on a website, including document detail pages, category list pages, model homepage, single pages, tag list pages, and tag detail pages.Each rule is composed in the form of "rule name===rule value" and is constructed into a unique URL path through a specific combination of variables.
AnQiCMS自定义伪静态规则支持的常用变量
When customizing the pseudo-static rules, AnQiCMS provides a series of flexible variables, allowing you to build rich URL structures based on content characteristics and SEO strategies. These variables are enclosed in curly braces{}Packaging, for easy system recognition and replacement with actual content.
Content ID ({id})
This variable represents the unique numeric identifier for each item of content on the website.Whether it is an article, product, single page, or tag, each entity has a corresponding ID in the database.{id}Can ensure the uniqueness of the URL, especially suitable for those scenes where the content title may be repeated or requires a concise URL. For example, the URL of an article detail page can be set as/article/{id}.html.
Data custom link name ({filename})
{filename}The variable is a content (such as an article, a single page, a tag) alias URL set manually by the user or automatically generated by the system during creation or editing.It is usually a short, descriptive English or pinyin string, which is an important tool for optimizing URL keywords.Embedding keywords in the URL can enhance the search engine's understanding of the page topic, which may lead to better rankings./article/seo-guide.htmlwhere,seo-guideit is{filename}the value.
Category custom link name ({catname})
With{filename}is similar,{catname}The variable is used to represent the custom URL alias for categories. It is also an optimized string used to describe the topic of the category. It is used when constructing the URL for the category list page.{catname}The value can make the URL more semantically and readable. For example, a category about 'News Updates' might be designed as/news/{catname}/list.htmlwhere,{catname}The value can belatest-news.
Category ID ({catid})
This variable represents the unique number identifier for the classification. Although it may not be as good in SEO as{catname}intuitive,{catid}It is very useful when you need to accurately point to a specific category by a digital ID, or as a concise URL pattern. The URL of a category list page may be set as/category/{catid}/list.html.
Model table name ({module})
{module}The variable represents the model identifier of the content.In AnQiCMS, you may have different content models such as "articles (archive){module}The URL alias of the model will be automatically replaced, helping to build a hierarchical URL structure. For example, the URL rule for the article detail page can be defined as/{module}/{filename}.htmlThen, for an article, its URL might be/article/my-first-post.html.
Page number (){page})
{page}is used to handle pagination on list pages. Its special feature is that it usually needs to be used with parentheses()Combined usage to indicate that it is optional. For example(-{page})This means that when the list has only one page, the pagination information will not appear in the URL, keeping the URL concise; when there are multiple pages, the page number will be automatically added to the URL, for example,/category/tech-news/page-2.htmlThis design avoids the home page from appearingpage-1Such redundancy information is more friendly to SEO.
Flexible combination, building the optimal URL
By flexibly combining the above variables, you can build URL structures for the AnQiCMS website that meet both search engine preferences and user habits. For example, a common combination of custom rules may look like this:
- Document details page:
archive===/{module}/{filename}-{id}.html- Example:
/article/anqicms-tutorial-123.html
- Example:
- Category list page:
category===/{catname}/list(-{page}).html- Example:
/news/company-updates/list.html(First page) - Example:
/news/company-updates/list-2.html(second page)
- Example:
- Single Page:
page===/{filename}.html- Example:
/about-us.html
- Example:
When configuring custom rewrite rules, please make sure to test each rule carefully to ensure they can be correctly parsed to the corresponding page, and pay attention to avoid creating duplicate or conflicting URLs.An English translation of 'auto' is 'English'.
Common Questions and Answers (FAQ)
1. What should I do if the website shows a 404 error page after modifying the custom static rule?
2. When customizing the URL,{filename}or{catname}How is the value generated? Can I control it manually?
{filename}and{catname}The value is usually generated automatically by the system based on the title you enter when creating or editing articles, products, single pages, or categories.You can find the "Custom URL" field on the edit page and manually modify these values according to your SEO needs.In order to optimize SEO, it is recommended to set it to keywords highly relevant to the page content and ensure its uniqueness throughout the entire site.If the manually entered value is not unique, the system usually appends random characters to it to ensure uniqueness.
3.{page}Variables(-{page})What is the special meaning of the format? Why is it used this way?
(-{page})The format represents the pagination page number{page}is an optional URL component. It is usually used on list pages, and when the list has only one page, the URL will not be displayed(-1)orpage-1such pagination information, for example/category/tech-news/list.htmlWhen the list has the second page and more, the URL will automatically add the page number, for example/category/tech-news/list-2.htmlThis design has two major advantages: first, it maintains the conciseness of the URL and avoids unnecessary redundant information; second, it is more friendly to SEO, preventing search engines from treating the 'first page' URL (such as/list-1.html误识别为重复内容,从而优化抓取效率和权重分配。(English)