In website operation, the importance of link structure is self-evident.An clear and meaningful URL can enhance user experience, make visitors easier to understand the page content, and is a key part of search engine optimization (SEO).Disorganized, dynamic URLs with a large number of parameters often make it difficult for search engine spiders to crawl and are not conducive to the transmission of keyword weights.Therefore, converting dynamic URLs to static forms is a common choice in modern website construction.
Auto CMS (AutoCMS) understands this point, built-in powerful pseudostatic URL configuration function, allowing you to flexibly define the link display structure of website content, thereby better serving SEO and user experience.
English static URL: Why is it so important?
The so-called pseudo-static, as the name implies, is still dynamically generated on the server side, but it displays as a static page in the URL address bar, for example, with.htmlendings. Compared with having?id=123&category=abcThis dynamic URL parameter, pseudo-static URL has many advantages:
- Improve SEO effectiveness:Search engines prefer concise, static URLs containing keywords.The static link is easier for search engine spiders to crawl and index, and the keywords embedded in the link also help to improve the search ranking of the relevant page.
- Improve user experience: A semantic URL, such as
/news/anqicms-update-log.html,/article.php?id=456It is easier to understand and remember. Users can also have a more intuitive understanding of the content pointed to by the link when sharing or revisiting. - Enhance the professionalism of the website:A clear URL structure gives a professional and reliable impression, helping to build users' trust in the website.
The journey of pseudo-static configuration in Anqi CMS
In AnQiCMS, configuring the pseudo-static URL rules is a relatively straightforward process. You can find the “Function Management” module in the back end。“Static rules" option.
1. Built-in pseudo-static mode: Quick Start
For the convenience of users, AnQiCMS provides four preset static page modes, which can meet the needs of most websites. These modes cover common URL structures, and you just need to select one and save it to apply:
- Number Pattern:English
/{模块别名}-{ID}.htmlin the form of, for example/article-123.html。This pattern is concise and clear, suitable for Chinese sites that pay attention to ID recognition. - Model naming pattern:The URL will include the alias of the model (such as articles, products), for example
/news/anqicms-update-log.html. Often used on English sites, highlighting the content's model. - 分类命名模式1 & 分类命名模式2: These two modes emphasize the category alias in URLs more, and can build something like
/technology/anqicms-features.htmlThis structure, choose according to your preference for the Chinese or English site.
These built-in patterns work well in most cases, allowing you to enjoy the benefits of pseudo-static without needing to delve into the writing of rules.
2. English Custom Mode: Fine-grained control of link structure
If you have more personalized needs for built-in modes or want to create a unique URL structure, AnQiCMS's “custom modeThis will be your **choice. It is an advanced feature that allows you to build links that match your website's content positioning and SEO strategy through flexible variable combinations.
需要注意的重要提示:EnglishThe configuration of custom modes needs to be very rigorous; any incorrect rules can lead to inaccessible pages. After modification and saving, please make sure to thoroughly test all pages of the website.
In custom mode, you will face six groups of core pseudo-static rules, each corresponding to a different type of page:
- archive: Used for document detail pages (such as articles, product details).
- category:Used for the category list page.
- archiveIndex:Used for the model homepage (such as the article list homepage).
- page:Used for single-page detail pages (such as About Us, Contact Information).
- tagIndex:Used for tag home pages.
- tag:Used for the tag detail page.
Each rule is followed规则名===规则值The format. In the "Rule Value", you can flexibly use various variables provided by AnQiCMS to construct the URL:
- {id}:Data ID, such as article ID, category ID.
- {filename}:The custom link name of the data (such as the alias of the document, the alias of a single page, the alias of Tag).
- {catname}:Custom link name for the category.
- {catid}Category ID.
- {module}:Model table name or URL alias (configurable in the background content model).
- {page}:Page number. It should be noted that
{page}the pagination variable must be enclosed in parentheses, for example(-{page}), indicating that pagination is optional and will be displayed only when the page number is greater than 1.
自定义规则示例:
Let us understand how to combine these variables through several common scenarios:
Document detail page (archive)
- Requirement:The article link should include the model alias and article ID, such as
/news/123.html.archive===/{module}/{id}.html - Requirement:The article link should include the model alias and custom filename, such as
/news/anqicms-features.html.
Here are thearchive===/{module}/{filename}.html{filename}来源于您在“添加文档”时填写的“自定义URL”字段。AnQiCMS会根据文档标题自动生成拼音别名,您也可以手动修改。 - Requirement:The product detail page link should include product model alias, category alias, and product ID, such as
/products/electronics/tv-001.html.archive===/{module}/{catname}/{filename}-{id}.html
- Requirement:The article link should include the model alias and article ID, such as
Category list page (category)
- Requirement:Hope the category link includes model alias and category ID, such as
/article/category/45.html.category===/{module}/category/{id}.html - Requirement:Hope the category link includes model alias and custom category name, and supports pagination, such as
/article/web-design(-{page}).html.
Here are thecategory===/{module}/{catname}(-{page}).html{catname}来源于您在“文档分类”中填写的“自定义URL”字段。
- Requirement:Hope the category link includes model alias and category ID, such as
Single page detail page (page)
- Requirement:Hope that the single page link directly uses the custom filename, such as
/about-us.html.
Here are thepage===/{filename}.html{filename}来源于您在“页面管理”中填写的“自定义URL”字段。
- Requirement:Hope that the single page link directly uses the custom filename, such as
标签详情页 (tag)
- Requirement:希望标签链接包含ID,并支持分页,如
/tag/123(-{page}).html.tag===/tag/{id}(-{page}).html - Requirement:Hope the tag link includes a custom tag name and supports pagination, such as
/tags/website-security(-{page}).html.
Here are thetag===/tags/{filename}(-{page}).html{filename}Originated from the "Custom URL" field filled in "Document Tags".
- Requirement:希望标签链接包含ID,并支持分页,如
When configuring these custom URLs, please make sure that the "Custom URL" field is reasonably filled out in the "Content Management{filename}and{catname}The output of the variable.
Test and maintenance after configuration
No matter which pseudo-static you choose