As an experienced CMS website operation personnel in the security industry, I know that a friendly and efficient URL structure is crucial for the website's search engine optimization (SEO) and user experience.The AnQi CMS provides a rich selection of pseudo-static rules, whether it's the ready-to-use preset modes or the highly flexible custom configurations, all of which can meet the needs of various websites.
Pseudo-static rules modes supported by AnQiCMS
The pseudo-static rules can rewrite dynamic parameterized URLs into static file URLs, which not only makes the URLs more readable but also more friendly to search engine crawlers, thus improving the website's SEO performance.The AnQi CMS provides several built-in pseudo-static rule patterns to adapt to different types of websites and operational strategies.
Number Pattern
A numeric pattern is a concise URL structure, mainly using the content ID (unique identifier) as the basis for generating the URL.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 in websites with Chinese characters because the URL generation of numerical 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, articles (archive) or products (product) and so on.This pattern is particularly common on English websites, where the URL not only contains the content ID but also clearly indicates the type of content, which helps to enhance the semanticization of the URL.
Category Naming Pattern 1 and Category Naming Pattern 2
These two patterns integrate the content category names into the URL structure, but may have different emphases in their specific implementation.For example, one pattern may be more focused on the hierarchical relationship between parent and child categories, while another may only include direct categories.The naming pattern for category names is beneficial for clear content organization, and it is of good application value for Chinese websites or multilingual websites where the URL reflects the hierarchical relationship of the content.They further strengthen the semantics of the URL by embedding the category name.
How to Customize URL Structure
In addition to the above four preset modes, Anqi CMS also provides powerful custom static rule functionality, which allows website operators to create unique URL structures based on specific business needs.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 centered around six main page types, which are: document detail page, document list page, model homepage, single page, tag list page, and tag detail page.Each custom rule follows the format of "rule name===rule value" for configuration.
When building rule values, you can flexibly use a series of predefined variables to dynamically generate URLs. These variables include:
{id}: represents the unique ID of the content.{filename}:represents a custom link alias for content (such as a document, a single page, or a tag).{catname}:represents a custom link alias for categories.{catid}:represents the unique ID for categories.{module}【en】:Represents the table name or URL alias of the content model.{page}【en】: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 may look like this:
archive===/{module}-{id}.html
category===/{module}-{filename}(-{page})
archiveIndex===/{module}.html
page===/{filename}.html
tagIndex===/tags(-{page})
tag===/tag-{id}(-{page})
In actual operation, the setting of custom URL structure aliases is throughout the content creation and management process.
DocumentIn the 'Add Document' or 'Edit Document' interface, there will be a 'Custom URL' field.The Anqi CMS will automatically generate a pinyin alias based on the document title 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 the custom URL of each document must be unique throughout the entire site.If the manually entered alias is not unique, the system will automatically add a random number to the end to ensure uniqueness.
CategoryIn the document classification management interface, when creating or editing categories, a 'custom URL' field will also be provided.It will also automatically generate a pinyin alias based on the category name.Similar to the document, the custom URL for classification also needs to ensure uniqueness across the entire site.
single pageIn the 'Page Management', each single page (such as 'About Us', 'Contact Information') has a 'Custom URL' field.The principle of operation is consistent with documents and categories, supports automatic generation of pinyin aliases and manual modification, and requires ensuring uniqueness.
tagsIn 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 must be unique across the entire site.In addition, the custom URL for the tag only supports letters, numbers, and underscores, and cannot contain spaces.
Through 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.
Common Questions and Answers (FAQ)
What problems could arise if I configure my custom rewrite rule incorrectly?Incorrect configuration of pseudo-static rules may cause website pages to be inaccessible (for example, 404 errors) 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 identified, please check and correct the rule configuration immediately.
What is the main difference between the 'Number Pattern' and 'Model Naming Pattern', and how should I choose between them?The digital pattern mainly uses the unique ID of the content as the main part of the URL, making the URL structure more concise, for example
/archive/123.htmlThe model naming pattern includes the model name in the URL, for example/article/123.htmlor/product/456.html.For websites mainly targeting Chinese users, or when a short URL is preferred, the 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 if you prefer English URL structures, the naming pattern of the model will be more advantageous.Why does the system automatically add random numbers to the end of my alias when setting a custom URL alias?The system will check the uniqueness of the alias in the entire site after you manually set a custom URL alias.If the alias you entered is already occupied by other documents, categories, single pages, or tags, to avoid link conflicts, the system will automatically append random numbers to the end of your alias to ensure that each page's URL is unique.To keep the URL neat, it is recommended to plan ahead and ensure the uniqueness of the custom alias when setting it.