In AnQiCMS, setting custom URL aliases for articles, categories, and tags is a very practical feature. It not only makes your website links more readable but also greatly benefits search engine optimization (SEO).An clear, keyword-rich URL, like a direction for search engines and users, helps enhance the professionalism and traffic of the website.
AnQiCMS was designed with SEO-friendliness in mind from the very beginning, featuring powerful pseudo-static and URL alias management functions.This means you can convert the originally dynamic, complex parameterized links into simple, static links, thereby making them better for search engines to crawl and index.
Understanding URL aliases and pseudo-static rules
Before we delve into the details, let's get to know two core concepts: URL alias and pseudo-static rules.
URL aliasIt is as the name implies, which is to set a unique, memorable and identifiable phrase as part of the URL for your content (articles, categories, tags, etc.).It usually consists of English words, numbers, and hyphens, and can directly reflect the content of the page.anqicms-features.
Static rulesThis is the configuration for URL rewriting on the server side of AnQiCMS.It tells the system how to match the URL alias you set with the actual dynamic content request on the backend.Only when the URL alias variables that can be called are included in your pseudo-static rules, can the alias you define take effect on the front-end page.AnQiCMS provides various built-in pseudo-static modes, also supports highly flexible custom rules, to meet the needs of various complex URL structure.
Configure the pseudo-static rules of the website: the basics first.
Before setting the URL alias for specific content, you need to determine the overall pseudo-static rules of the website. This is the basis for the effectiveness of custom URL aliases.
Enter the URL Rewrite Rule Management Interface:Log in to the AnQiCMS backend, navigate to the 'Function Management' menu, and then click 'Static Rule'.
Select or customize the rule:
- AnQiCMS provides various preset rules such as 'Digital Pattern', 'Model Naming Pattern', 'Category Naming Pattern', etc., which you can select according to your needs.These rules already include common URL structures, making it convenient for you to quickly enable pseudo-statics.
- However, to fully utilize the potential of custom URL aliases, we usually choose the 'Custom Mode'.In Custom mode, you can flexibly combine different variables to build URL structure.
{id}The unique ID of the content.{filename}:The custom URL alias for articles or tags.{catname}The custom URL alias of the category.{module}:URL alias for content models (for example, the corresponding model for articles might be)article,for product models might be)product).{page}:Page number (usually(-{page})indicates optional).
An example of a common combination of custom rules might be like this:
archive===/{module}/{filename}.html(Detail Page of Article)category===/{module}/{catname}(-{page})(Category List Page)tag===/tag/{filename}(-{page})(Tag List Page)These rules mean that the system will generate the final URL based on the aliases you set for articles, categories, and tags, combined with the aliases of the content model. Make sure that the rules you choose or customize include variables corresponding to the alias type you intend to set (for example, article aliases need
{filename}Category alias is required{catname}).
Set custom URL alias for article (document)
The URL alias of the article (also commonly referred to as "document" in AnQiCMS) is an important part of SEO optimization.
Enter the article editing interfaceIn AnQiCMS backend, go to 'Content Management' under 'Publish Document' or 'Document Management' and select an existing article to 'Edit'.
Locate the "Custom URL" fieldIn the article editing page, you will see a field named "Custom URL".
Set URL alias:
- 自动生成:By default, after you enter the article title, AnQiCMS will automatically generate a custom URL alias based on the pinyin of the title.This is very convenient for quick content publishing.
- 手动输入:If you are not satisfied with the automatically generated alias, or wish to include specific English keywords, you can enter them manually here.Please ensure that the alias you enter is unique across the entire site and only contains letters, numbers, and underscores, avoiding spaces or other special characters.If the system detects non-uniqueness, it may automatically add numbers after the alias to ensure uniqueness.
The value of this 'Custom URL' field will be used in your static rules, through
{filename}the variable being called to form the final article link.
Set a custom URL alias for categories
The category page is the key to the organization structure of the website content, and its URL also needs to be optimized.
Enter the category editing interfaceIn AnQiCMS backend, go to 'Content Management' under 'Document Categories', find the category you want to edit, and click the 'Edit' button.
Locate the "Custom URL" fieldIn the "Other Parameters
Set URL alias:
- 自动生成:and the article is similar, the system will automatically generate the pinyin alias based on the category name you enter.
- 手动输入You can manually input a concise, keyword-containing English alias based on the category content.Similarly, this alias must ensure uniqueness throughout the entire site and should only use English letters, numbers, and underscores.
The "Custom URL" field here corresponds to the pseudo-static rules.
{catname}a variable.Moreover, it is worth mentioning the URL alias of the content model.In the "Content Management" -> "Content Model", each model (such as article model, product model) itself also has a "URL Alias" field. This alias (such as
articleorproductIt will be processed through the pseudo-static rules{module}The variable is called. Make sure the alias set here is concise and descriptive in English lowercase letters, as it will become the prefix for all articles and categories URLs under this model.
Set custom URL alias for label
The tab aggregates content of a specific theme and is an important way for users to discover relevant information.
Enter the label editing interfaceIn AnQiCMS backend, go to 'Content Management' under 'Document Tags', select the tag you want to edit, and click the 'Edit' button.
Locate the "Custom URL" field:In the tag editing page, you will find the "Custom URL" field.
Set URL alias:
- 自动生成:The system will automatically generate pinyin aliases based on the tag name.
- 手动输入:You can manually create an English alias containing keywords. The alias must also ensure uniqueness across the entire site and can only contain letters, numbers, and underscores, without any spaces.
The "Custom URL" field of the label is usually also called through the pseudo-static rules
{filename}by variables, for exampletag/{filename}.
Summary
Through the above steps, you can set personalized URL aliases for articles, categories, and tags in AnQiCMS.This not only makes your website links look more professional, more user-friendly, and easier to remember, but also significantly improves your website's performance in search engines.During the setup process, please ensure that the alias is concise, relevant, and unique, and make sure that the pseudo-static rules match the URL structure you expect.
Common Questions (FAQ)
1. Why didn't the front-end page link work or show a 404 error after I set the custom URL alias?The most common reason for this situation is that the pseudo-static rules are not configured correctly or do not match your custom alias. Please check:
- Are the pseudo-static rules enabled and correctly set?Confirm that you have selected "Custom mode" in "Function Management" -> "URL Rewrite Rules".