As an experienced website operations expert, I know that URL structure is crucial for the website's search engine optimization (SEO) and user experience (UX).A clear and semantically meaningful URL not only helps search engines better understand the content of the page, but also makes it more intuitive and trustworthy for users to visit.In AnQiCMS (AnQi CMS), flexible configuration of pseudo-static rules is the key to achieving this goal.Today, let's delve into how to configure the pseudo-static rules in AnQiCMS to optimize your website URL structure.
Why is the pseudo-static URL so important?
In the daily operation of website management, we often encounter such problems: dynamic URLs (for example/?id=123&category=newsDue to its excessive parameters and poor readability, it is often not favored by search engines and users.They look chaotic and difficult to remember and share, and are also likely to be mistaken by search engines for duplicate content.
Static URLs (for example/news/anqicms-update.htmlThese issues can be effectively resolved. It is identical in form to a real static HTML page, but on the server side, these "static" requests are mapped to dynamic content through URL rewriting mechanisms.The benefits of this optimization are self-evident:
- Improve SEO performance:Search engines prefer URLs that are concise and contain keywords. Static URLs make it easier for search engines to crawl and index content, and may improve keyword rankings.
- Improve user experience:Users can intuitively understand the content of the page from the URL, for example, seeing
/about-us.htmlThey can know it is about us page. This increases trust and is convenient for users to remember and share. - Enhance website security:Hid the backend parameters, reducing the risk of malicious exploitation.
AnQiCMS as an enterprise-level CMS that focuses on SEO naturally takes static aliasing as one of its core features, providing us with powerful and flexible configuration options.
AnQiCMS Static Ability Overview
AnQiCMS has built-in static and 301 redirect management features, aimed at helping users improve SEO effects by optimizing URL structure.Under the 'Function Management' module of the system, you can find the option 'Static Rule', and all related configurations are carried out here.
Configure Static: From Basic to Advanced
AnQiCMS Static configuration is divided into two main methods: preset rules and custom rules.
Set rules: easy to get started
For most AnQiCMS users, the four preset static rules provided by the system are already able to meet the daily operation needs. These rules are designed very user-friendly, and you can quickly choose according to your website type and target audience:
- Numeric mode:The URL primarily uses the ID of the content as an identifier, for example
/article/123.htmlThis pattern is concise and clear, especially suitable for Chinese sites, as users have a high acceptance of numerical IDs. - Model naming pattern:The URL will include the name of the model to which the content belongs and the custom alias of the content, for example
/news/anqicms-update.htmlThis pattern is more semantic, very friendly to English sites or sites pursuing more descriptive URLs, allowing the URL to directly reflect the content theme. - Category naming pattern 1:The URL will include the custom alias of the category name and content, for example
/company-news/anqicms-update.html. This pattern is common on Chinese sites and can clearly show the hierarchical relationship of the content. - Category naming pattern 2:It includes category names and content aliases, but is usually different in structure (depending on the implementation of AnQiCMS, but the purpose is the same).It is also mainly used on English sites, pursuing clear classification levels.
Selecting the preset rule is very simple, just select the one you prefer in the background and save it. AnQiCMS will automatically manage the URL rewrite for you.
Custom rules: Fine-grained control
For operators with higher requirements, or in scenarios where the website URL structure has special design needs, AnQiCMS provides powerful custom static rules functionality.This belongs to the advanced mode, but once mastered, you will be able to refine your control over the URL structure.
In custom mode, you can set independent static rules for six different types of pages, which are:
- Document Details Page (archive)
- Document List Page (category)
- Model Home Page (archiveIndex)
- Single Page (page)
- Tag List Page (tagIndex)
- Tag Details Page (tag)
Each custom rule follows规则名===规则值format. In规则值In Chinese, you can flexibly use a series of built-in variables to construct URLs:
{id}: Unique ID of the content.{filename}Custom URL alias for content (article, product, single page, or tag).This is usually the pinyin of the content title or the manually set English alias, which is the key to semanticized URLs.{catname}Custom URL alias for a category.{catid}Unique ID of the category.{module}: The URL alias of the content's model (for example, the article model might bearticle, the product model could beproduct){page}: Used for pagination. It should be noted that the pagination variable must be enclosed in parentheses, for example(/{page}), so that the system can identify it correctly.
An example of a custom rule:
archive===/{module}/{filename}.html
category===/{module}/list-{catid}(-{page}).html
archiveIndex===/{module}.html
page===/{filename}.html
tagIndex===/tags(-{page}).html
tag===/tag-{filename}.html
In this example:
- The URL for the article detail page will be
/{模型别名}/{内容自定义别名}.htmlFor example/article/anqicms-tutorial.html. - The URL for the category list page will be
/{模型别名}/list-{分类ID}.htmlIf there are multiple pages, it will be/{模型别名}/list-{分类ID}-2.html. - The URL for a single page will be
/{自定义别名}.htmlFor example/about-us.html.
Key Tips:To make{filename}and{catname}The variable takes effect, you need to manually fill in or automatically generate the URL alias in the corresponding 'Custom URL' field when publishing or editing articles, products, single pages, categories, and tags in the AnQiCMS background.These aliases are the foundation for building semantically meaningful URLs.
Save and take effect
No matter which preset rule or custom rule you choose, after saving, AnQiCMS will immediately start using the new URL structure internally.It should be noted that in order to ensure that these pseudo-static URLs can be accessed normally on your website, your server (such as Nginx or Apache) must be properly configured to forward all requests to AnQiCMS for processing, usually through a "catch-all" or reverse proxy rule.The installation guide for AnQiCMS usually provides these server-side configuration examples.