AnQiCMS provides a flexible and powerful pseudostatic URL structure setting function in website operation, which is crucial for the SEO performance and user experience of the website.Static URL, as the name implies, makes the links of dynamically generated pages look like simple and regular file paths, thereby making it easier for search engines to crawl and for users to understand.
Why is the pseudo-static URL so important?
Before delving into how AnQiCMS sets up URL rewriting, let's briefly review why it occupies such an important position in website operation:
- Improve search engine optimization (SEO): Search engine spiders prefer URLs that are structured clearly and semantically explicit.Static URLs usually contain meaningful keywords, rather than a string of unordered parameters, which helps search engines better understand the content of the page and thus improve the inclusion and ranking of the website.
- optimize user experienceA concise and readable URL is not only convenient for users to remember and share, but can also increase users' trust in the website to some extent.When a user sees a clean URL, they are more likely to click and browse.
- Enhance link stability: The dynamic URL may become invalid due to parameter changes.Once a static URL is set, it usually remains relatively stable, reducing the occurrence of dead links, which is particularly beneficial for long-term operation of websites.
AnQiCMS fully understands these advantages, therefore, in the system design, it takes pseudo-static as a core feature, providing users with a variety of settings from convenient selection to in-depth customization.
The core implementation mechanism of AnQiCMS static aliasing
AnQiCMS combines backend routing rules with frontend page rendering to achieve pseudo-static.In simple terms, when a user accesses a pseudo-static URL, the website server (such as Nginx, Apache) will forward the request to the AnQiCMS application.AnQiCMS again parses the content that the user actually wants to access according to the internal static rule configuration (for example, article ID, category ID), then retrieves the corresponding data from the database and renders the page, and finally returns it to the user.
Two modes of settings: quick start and deep customization
AnQiCMS provides two kinds of static settings for users to meet different needs:
1. Built-in static rules: a convenient choice
For most users, the four built-in static rules provided by AnQiCMS are sufficient to meet daily needs, covering common URL structures for Chinese and English websites, allowing you to have SEO-friendly links without complex configuration:
- Numeric pattern: Use the content ID as the unique identifier for the URL. For example:
/article/123.html. - Model naming pattern: Include the alias of the content model (such as article, product) in the URL for better semantics. For example:
/article/seo-guide.html. - Classification naming pattern 1: Include category alias in the URL, which is commonly used on Chinese websites. For example:
/news/industry-trends-123.html. - Classification naming pattern 2: It also includes category aliases, but may use different delimiters or structures, more suitable for English sites. For example:
/category/news/article-title.html.
These built-in rules can be directly selected and enabled in the 'Function Management' -> 'URL Rewrite Rule' section of the AnQiCMS backend, which is very suitable for users who want to quickly build a website.
2. Customize the pseudo-static rules: have everything under control
If you have a specific SEO strategy, brand needs, or need to maintain consistency with the old website's URL structure, AnQiCMS's custom static rule feature will provide ultimate flexibility.This belongs to the advanced mode, it needs to be particularly meticulous in configuration to avoid the page from being inaccessible.
Customize the pseudo-static rules can be set for the following six types of pages:
- Document details page (
archive): such as articles, product detail pages. - Document list page (
category): such as category list pages. - Model homepage (
archiveIndex): Such as article homepage, product homepage. - Single page (
page): Such as 'About Us', 'Contact Us' and other independent pages. - Tag list page (
tagIndex): Display page for all tags. - Tag detail page (
tag): Display page for contents under a specific tag.
Each custom rule follows规则名===规则值format. For example,archive===/{module}-{filename}.html.
In规则值In Chinese, you can flexibly use the variables provided by AnQiCMS to construct your URL:
{id}: The unique ID of the content (such as article ID, category ID).{filename}: The custom URL alias for content.{catname}Custom URL alias for a category.{catid}Unique ID of the category.{module}The content model (such as)article/productURL alias for ).{page}Page number.Please note: Page number variable.{page}Must be in parentheses.()Wrapped in, for example.(-{page})It indicates that pagination is optional and is displayed only when pagination is present.
Custom rule example:
`conf
Document details page: Model alias/Content alias.html
archive===/{module}/{filename}.html