What are the pseudo-static rule modes supported by AnQiCMS, and how to customize the URL structure?
As an experienced CMS website operation personnel of an enterprise, I know that a friendly and efficient URL structure is crucial for the website's SEO and user experience.The Anqi CMS provides a rich selection of rules for pseudo-static, whether it is the ready-to-use preset mode or the highly flexible custom configuration, it can meet the needs of various websites.
Pseudo-static rules supported by AnQiCMS
The static rules can rewrite dynamic parameterized URLs into static file-formatted URLs, which not only makes the URL more readable but also more friendly to search engine crawlers, thus improving the website's SEO performance.AnQi CMS provides several built-in pseudo-static rule modes to adapt to different types of websites and operational strategies.
Numeric pattern
The number pattern is a concise URL structure, mainly based on the content ID (unique identifier) for URL generation.In the document detail page, document list page, single page and tag page, the URL usually contains the numeric ID of the content.This pattern is widely used on websites with Chinese character content because the URL generation of numeric IDs is more stable and direct.
Model naming pattern
The model naming pattern introduces the name of the content model as an identifier in the URL.For example, an article (archive) or a product (product), etc.This pattern is particularly common on English websites, making the URL not only contain the content ID but also clearly indicate the type of content, which helps improve the semanticization of the URL.
Category naming pattern 1 and Category naming pattern 2
These two patterns integrate the category name of the content into the URL structure, but may have a focus on specific implementation.For example, one pattern may be more focused on the hierarchical relationship between parent and child categories, while another may only contain direct categories.The category naming pattern is clear for content organization, and it is beneficial for Chinese websites or multilingual websites that hope the URL reflects the hierarchy of content.They further strengthen the semantics of the URL by embedding the category name in it.
How to customize URL structure
In addition to the above four preset modes, Anqi CMS also provides powerful custom static rule functions, which allow website operators to create unique URL structures according to specific business needs.The custom mode is an advanced feature that requires more detailed configuration to ensure the smooth operation of the website.
The configuration of custom rules is based on six main page types, which are: document detail page, document list page, model home page, single page, tag list page, and tag detail page.Each custom rule follows the format "rule name===rule value" for configuration.
When building rule values, you can flexibly use a series of preset variables to dynamically generate URLs. These variables include:
{id}This represents the unique ID of the content.{filename}Represents a custom link alias for content (such as a document, single page, or tag).{catname}Represents a custom link alias for categories.{catid}Represents the unique ID for categories.{module}: Represents the table name or URL alias of the content model.{page}: Represents the page number for pagination, which should be placed within parentheses when used, for example.(/{page}).
By combining these variables, you can create various complex URL structures. For example, a typical set of custom rules might look like this:
archive===/{module}-{id}.html
category===/{module}-{filename}(-{page})
archiveIndex===/{module}.html
page===/{filename}.html
tagIndex===/tags(-{page})
tag===/tag-{id}(-{page})
This example rule demonstrates how to configure unique URLs for different types of pages.For example, the URL of the document detail page will include the model name and document ID;The URL of the category page will include the model name and the custom alias of the category, and optionally pagination information can be added.This high degree of flexibility allows you to design URLs for every important page on the website that are both beneficial for SEO and consistent with the brand image.
In actual operation, the setting of custom URL structure aliases runs through the content creation and management process.
DocumentIn the "Add Document" or edit document interface, there will be a "Custom URL" field.The AnqiCMS will automatically generate a pinyin alias based on the title of the document you enter as the default value.You can choose to accept the default value or manually enter a custom alias.It should be noted that each document's custom URL must be unique throughout the entire site.If the manually entered alias is not unique, the system will automatically add a random number after it to ensure uniqueness.
CategoryIn the document category management interface, when creating or editing categories, a 'custom URL' field is also provided.It will also automatically generate a pinyin alias based on the category name. Similar to the document, the custom URL of the category also needs to ensure the uniqueness of the entire site.
single pageIn the "Page Management" section, each single page (such as "About Us", "Contact Information") has a "Custom URL" field.The principle of its operation is consistent with documents and categories, supports automatic generation of pinyin aliases and manual modification, and requires uniqueness.
TagIn the "Document Tag" management, you can set a "custom URL" for each tag.This custom URL also supports automatic pinyin generation and manual modification, and it must be unique across the entire site.In addition, the custom URL of the tag only supports letters, numbers, and underscores, and cannot contain spaces.
By careful planning and configuration, the pseudo-static feature of Anqi CMS can help you build a website that is friendly to search engines and provides a smooth user experience.
Frequently Asked Questions (FAQ)
What problems would I encounter if I configure my custom static rule incorrectly?Incorrect configuration of pseudo-static rules may cause website pages to be inaccessible (for example, a 404 error occurs), or links to incorrect content.Before enabling custom rules, it is recommended to conduct thorough testing in a test environment and ensure that all important page links can be correctly parsed.Once a problem is found, please check and correct the rule configuration immediately.
What is the main difference between 'numeric pattern' and 'model naming pattern', and how should I choose?The numeric pattern primarily uses the unique ID of the content as the main component of the URL, making the URL structure simpler, for example
/archive/123.html. The model naming pattern will include the content model name in the URL, for example/article/123.htmlor/product/456.html. For websites mainly aimed at Chinese users, or when a short URL is preferred, a numeric pattern may be a good choice.If your website has a variety of content types and you want the URL to clearly indicate the content type, or you prefer an English URL structure, then the model naming pattern will be more advantageous.Why does the system automatically add random numbers to the end of my alias when setting a custom URL?The system will check the uniqueness of the custom URL alias you set manually after it is checked within the entire site range.If the alias you enter has been occupied by other documents, categories, single pages, or tags, the system will automatically append a random number to your alias to avoid link conflicts, ensuring that each page's URL is unique.To maintain the cleanliness of the URL, it is recommended to plan ahead when setting a custom alias and try to ensure its uniqueness.