In website operation, the display form of the front-end link (URL) is crucial for user experience, search engine optimization (SEO), and brand image.A concise, meaningful, and well-structured URL can not only help users better understand the page content, but also improve the efficiency of search engine crawling and ranking.AnQiCMS (AnQiCMS) fully understands this need and provides a flexible custom URL alias feature, allowing us to precisely control the link display of categories, documents, and single pages on the website front end according to our needs.
Understand the importance of frontend links and pseudo-statics
Before delving into custom URL aliases, we need to understand the concept of 'pseudo static'.Static URLs are a technique used to rewrite URLs of dynamically generated web pages, converting them into addresses that look like static pages (usually ending with .html, .htm or directly as a directory format).The Anqi CMS is built with powerful pseudo-static functionality, which makes our website links more readable and more friendly to search engines, thereby effectively improving SEO effectiveness.
The pseudo-static settings of AnQi CMS are mainly concentrated in the "Pseudo-static Rule" under the "Function Management" menu in the background.Here, we can choose from several predefined rules of the system, such as 'number pattern', 'model naming pattern', or 'category naming pattern', which can meet the needs of most websites.But when we need a more fine-grained, personalized link structure, "custom mode" becomes our preferred choice.
Custom URL alias: the cornerstone of refined link management
The custom URL alias is a core feature of AnQi CMS, which allows us to assign a unique, descriptive English identifier to each category, document, and single page on the website.This identifier is the specific name in the front-end link, which is the basis for constructing personalized URL structures.
URL alias setting for category pages:When creating or editing categories, under the "Content Management" section, find the "Document Category" interface, and in the "Other Parameters" section, you will see an input box named "Custom URL".The system will automatically generate a pinyin alias based on the category name we fill in, for example, "News Information" may generate "xinwenzixun".If this automatically generated alias does not meet our expectations, we can manually modify it, changing it to a more meaningful English word or phrase, such as 'news-updates'.In custom rewrite rules, we can use
{catname}This variable is used to refer to the custom URL alias of the category.Document page URL alias setting:For each document, whether it is an article or a product, we can also set its alias in the "Custom URL" field under the "Content Management" section when adding or editing a document interface.By default, the system will automatically generate aliases based on the document title, for example, a document named "Anqicms Quick Start" may have an alias such as "anqicms-quick-start".We can also manually modify it to 'get-started-anqicms' and so on, making it more concise and clear.In custom pseudo-static rules, we can use
{filename}This variable is used to reference the custom URL alias of the document.Single page URL alias setting:A single page, such as "About Us", "Contact Us", etc., when editing under "Page Resources" in "Page Management", it also provides an option for "Custom URL".Similar to categories and documents, we can set aliases for it based on page content, such as "about-us", "contact", etc., to enhance the intuitiveness of the URL.Just like the document page, the alias of the single page also goes through the custom static rules
{filename}Variable to reference.
Tip:When setting a custom URL alias, the system will automatically check its uniqueness throughout the entire site.If a conflict is found, the system will automatically add a random number to the alias to ensure uniqueness. Therefore, to keep the URL tidy, it is recommended that we try to ensure its uniqueness when setting manually.Moreover, for the URL alias of the content model, it can be set under "Content Management" -> "Content Model", which is usually used to define the common prefix for all content under the model, corresponding to the static rules in pseudo-static rules.{module}Variable.
Advanced: Implementing fine-grained link structure through custom pseudo-static rules
Only the alias has been set, it is not enough to completely control the display form of the front-end link.The real power lies in the "custom mode" under the "pseudo-static rule" of the "function management".Here, we can define a set of our own URL structure rules and apply the custom URL alias set earlier.
After selecting "Custom mode", we can configure in six groups of rules such as document details, document list, single page, etc. Each rule follows规则名===规则值The format. The key is to use the variables provided by Anqi CMS:
{id}: Data ID, usually used for links with pure numbers.{filename}: Custom URL alias for documents or single pages.{catname}Custom URL alias for a category.{module}URL alias for content model.{page}Page number.
Here are some examples of custom rules:
Implement the URL structure for category name/document name:If you want the URL of the article detail page to be:
你的域名/分类别名/文档别名.htmlYou can set up the pseudo-static rules like this:archive===/{catname}/{filename}.htmlAnd the category list page might be:category===/{catname}/Implement the URL structure for module prefix/document name:If your website has many content models (such as articles, products), you want the document links of different models to have a model name prefix, for example
你的域名/article/文档别名.htmlYou can set it like this:archive===/{module}/{filename}.htmlCustom single page URL:For a single page, if you want the URL of the "About Us" page to be
你的域名/about-us.htmlIn addition to setting the alias to "about-us" in the single-page management, it is also necessary to ensure that the pseudo-static rules match:page===/{filename}.html(If general, or more specifically for a single page specification)page/about-us.htmlBut this usually refers to the template filename, not the pseudo-static rules themselves)
By flexibly combining these variables, we can create a URL structure that meets the needs of our own website, both aesthetically pleasing and beneficial for SEO.
Summary of operational process
- Set alias:In the "Content Management" section, under "Document Categories", "Add/Edit Document", and "Page Resources" page management, manually set or modify the "Custom URL" alias according to the actual content for categories, documents, and single pages.
- Configure pseudo-static rules:Enter the "Function Management" under the background "URL Rewrite Rule", select the "Custom Mode".
- Define the rule:Use according to the required URL structure,
{filename}/{catname}/{module}Wait for variables, write the corresponding pseudo-static rules. - Save and test:After saving the rules, be sure to clear the website cache and access the relevant pages on the front end to check if the URL is displayed as expected and whether the page content loads normally.
Points to note
- Uniqueness is crucial:Whether it is a category, document, or custom URL alias for a single page, it should ensure the uniqueness throughout the entire site to avoid link conflicts and parsing errors.
- SEO friendliness:The URL structure should be concise, contain keywords, and avoid being too long or including too many unnecessary parameters.Using custom URL aliases can significantly improve a website's performance in search engines.
- Change with caution:Frequent changes to the URL structure or aliases may affect the search engine's inclusion and ranking of the website.If it is indeed necessary to modify the published URL, it should be done in conjunction with the 301 redirect function provided by AnQi CMS, to correctly direct the old link to the new link, avoiding traffic loss and dead link generation.
- Testing is essential:Any changes to pseudo-static rules or custom URL aliases must be thoroughly verified in the testing environment to ensure that all pages can be accessed normally.
By using the custom URL alias and pseudo-static rules provided by AnQi CMS, we can fully control the display of the website's front-end links, providing users with a better access experience and laying a solid foundation for the website's SEO.
Frequently Asked Questions (FAQ)
**1. Modified the custom URL alias