In AnQi CMS, building clear and accessible links for your website content is a key factor in optimizing user experience and search engine rankings. Among them, utilizingcategorythe object ofurl_tokenBuild category links, which is an efficient and SEO**compliant method.
Understandingurl_tokenThe role in category links
url_tokenIs a unique identifier provided by AnQin CMS for each category, usually a short, descriptive English word or拼音, used to represent the category in URLs. It is not just a number like the category ID.url_tokenMore readable and meaningful, for example, a category named “News Updates”,"url_tokenmay be set as “news” or “xinwen”.
Why is this important? When search engines crawl your website, they prioritize pages with clear, descriptive URLs. One that includesurl_token categorized links, such ashttps://www.yourwebsite.com/news, is much better thanhttps://www.yourwebsite.com/category_id=123Such links can better help search engines understand the content of the page and also enhance users' trust in the links. Users are more likely to share or remember links that are short and meaningfulurl_tokenand are also more popular.
How to get the categoryurl_token?
To build the category link, you first need to obtain its correspondingurl_token. There are several ways to easily get this information in the Anqi CMS.
When you retrieve the document details through the API (archiveDetail), the returneddataobject will contain acategorysub-object. Thiscategoryobject provides detailed information about the document's category, including url_tokenField. For example:
"category": {
"id": 1,
"title": "AnqiCMS帮助",
"url_token": "goruning", // 这里的 "goruning" 就是该分类的 url_token
// ... 其他分类信息
}
In addition, when you need to get the list of categories (categoryList), each category item returned by the API also providesurl_tokenYou can get the required link to the category of a single document, or list all categories in the navigation bar or sidebar, in this way.url_token.
The actual operation of building category links
Henceurl_tokenOnce the category links are built, it becomes very straightforward. You need the root domain of the website, which is configured in the AnQi CMS system settings.BaseUrlFor example, if your websiteBaseUrlYeshttps://en.anqicms.com, and a certain categoryurl_tokenYeshelp, then the complete link of that category can be simply concatenated as:
{BaseUrl}/{url_token}
Specifically, it is:https://en.anqicms.com/help
This construction method is concise and clear, convenient for users, and very friendly to search engines. It is worth noting that the Anqi CMS usually adopts this flattened URL structure, that is, categoriesurl_tokenFollowed directly after the domain name. If your website is configured with more complex routing rules, such as in the moduleurl_tokenFollowed by categoriesurl_token(such ashttps://en.anqicms.com/news/industry-news),then you need to concatenate according to the actual routing configuration. But the core idea is to utilizeurl_tokenas part of the URL path.
Summary
Make full use ofcategorythe object ofurl_tokenTo build classification links is an important part of the security CMS content operation.It not only makes your website URL structure clearer and easier to manage, but also directly improves the website's performance in search engines and the user experience.By simple concatenation, you can create professional and well-readable category page links.
Common Questions (FAQ)
Q:
url_tokenCan it contain Chinese characters or special characters?Answer: Generally speaking,url_tokenSuggested to use a combination of English letters, numbers, and hyphens (-), avoiding the use of Chinese or other special characters. Although some systems may support Chinese URLs, for compatibility, SEO effectiveness, and to avoid encoding issues, it is recommended to use standardized English.url_tokenIs**a choice. The document of Anqi CMS also clearly points out that custom URL aliases only support numbers and letters, so it is recommended to follow this rule.Ask: If I change the category,
url_tokenwill the old link become invalid?Answer: Changing the category,url_tokenAfterward, the old link will indeed become invalid. To avoid users encountering a 404 error page and the negative impact on search engines, it is strongly recommended that in the changeurl_tokenAfterward, immediately set up a 301 permanent redirect on your server. This will direct the old URL to the new URL, ensuring that traffic and weight are smoothly transferred.Question: Does each category need to be unique?
url_tokenMust each one be unique?Answer: Yes, each category needs to be unique.url_tokenIt should be unique under its respective module.url_tokenAs the unique URL alias for the category, if there is a duplicate, the system will not be able to correctly parse the user's request, leading to inaccessible pages or content confusion. The Anqi CMS is designed to strictly enforce this requirement.url_tokenThe uniqueness, to ensure the accuracy of the routing.