In AnQiCMS, setting up 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).A clear, keyword-rich URL, like a guide for search engines and users, helps enhance the professionalism and traffic of the website.
AnQiCMS was designed with SEO-friendliness in mind from the beginning, featuring powerful static and URL alias management functions.This means you can convert the original dynamic link with complex parameters into a concise, static link form, which is better for search engines to crawl and index.
Understanding URL aliases and pseudo-static rules
Before we delve into the details, let's understand two core concepts: URL alias and pseudo-static rules.
URL aliasThis is a unique, memorable, and identifiable phrase set 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.For example, an article about the 'AnQi CMS feature introduction' may have a URL alias such asanqicms-features.
Static rulesIt is the configuration for AnQiCMS to perform URL rewriting on the server.It tells the system how to match the URL alias you set with the actual dynamic content requests on the backend.Only when the URL alias variable that can be called in your pseudo-static rules is included, the alias you define can take effect on the front page.AnQiCMS provides a variety of built-in static page modes and supports highly flexible custom rules to meet the needs of various complex URL structures.
Configure the pseudo-static rules of the website: basic first.
Before setting a 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 pseudo-static rules management interface: Log in to the AnQiCMS backend, navigate to the "Function Management" menu, and then click on "Static Rule".
Select or customize the rule:
- AnQiCMS provides various preset rules such as 'numeric pattern', 'model naming pattern', 'category naming pattern', and you can choose 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 the URL structure.For example, the document mentions some available variables:
{id}: Unique ID of the content.{filename}Custom URL alias for articles or tags.{catname}Custom URL alias for a category.{module}URL alias for content models (for example, the article model might correspond to)articleProduct model might correspond to.product){page}: Page number (usually used(-{page})Optional.)
A common combination of custom rules may look like this:
archive===/{module}/{filename}.html(Article detail page)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, the article alias needs to include the following information in the URL: Article Title, Category, Tag, and Date.
{filename}, category alias required{catname})
Set a custom URL alias for articles (documents)
The URL alias of an 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 the URL alias:
- Automated generationBy 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.
- Manual inputIf you are not satisfied with the automatically generated alias or want to include specific English keywords, you can enter them manually.Make sure 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 that it is not unique, it may automatically add a number to the alias to ensure uniqueness.
The value of this 'Custom URL' field will be used in your static rules to
{filename}call the variable to form the final article link.
Set a custom URL alias for categories
The category page is the key to the website's content organization structure, and its URL also needs to be optimized.
Enter the category editing interfaceIn AnQiCMS backend, go to 'Content Management' under 'Document Category', find the category you want to edit, click the 'Edit' button.
Locate the "Custom URL" fieldIn the 'Other Parameters' section of the category editing page, you will find the 'Custom URL' field.
Set the URL alias:
- Automated generationAnd similar to the article, the system will automatically generate a pinyin alias based on the category name you enter.
- Manual inputYou can manually enter a concise English alias containing keywords based on the category content.Similarly, this alias must be unique within the entire site and must only use letters, numbers, and underscores.
The "custom URL" field here corresponds to the static rules in the pseudo-static rules.
{catname}Variable.Moreover, it is worth mentioning the URL alias of the content model.In the 'Content Management' -> 'Content Model', each model (such as the article model, product model) also has a 'URL alias' field. This alias (for example
articleorproductIt will pass through the pseudo-static rules{module}The variable is called. Ensure that the alias set here is concise and descriptive in lowercase English letters, as it will become the prefix for all articles and category URLs under this model.
Set a custom URL alias for the tag
The tag page aggregates content on a specific theme and is an important way for users to find relevant information.
Enter the tag 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" fieldOn the label editing page, you will find the 'Custom URL' field.
Set the URL alias:
- Automated generationThe system will automatically generate a pinyin alias based on the label name.
- Manual input: You can manually create an English alias containing keywords. The alias must also ensure uniqueness across the entire site, and it can only contain letters, numbers, and underscores; it cannot contain spaces.
The "Custom URL" field of the tag is usually accessed through
{filename}variables, for exampletag/{filename}.
Summary
By following these steps, you can set personalized URL aliases for articles, categories, and tags in AnQiCMS.This can make your website link look more professional, easier for users to understand and remember, and can significantly improve your website's performance in search engines.During the setup process, please ensure that the alias is concise, relevant, and unique, and that the static rules match the URL structure you expect.
Frequently Asked Questions (FAQ)
1. Why didn't the front page link work or show a 404 error after I set up a custom URL alias?This situation usually occurs because the pseudo-static rules are not configured correctly or do not match your custom aliases. Please check:
- Are the pseudo-static rules enabled and set up correctly?: Confirm that you have selected "Custom mode" in "Function Management" -> "URL Rewrite Rules", and the rules in