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, usingcategoryWithin the objecturl_tokenTo build a category link is an efficient method that conforms to SEO**practices.
Understandingurl_tokenThe role of category links.
url_tokenIs an AnQi CMS that provides a unique identifier for each category, usually a short, descriptive English word or pinyin, used to represent the category in URLs. It is not like the category ID that is just a number,url_tokenReadability and meaning, for example, a category named “News Dynamic”, itsurl_tokenmay be set to “news” or “xinwen”.
Why is this important? When search engines crawl your website, they prioritize pages with clear, descriptive URLs. A page that includesurl_token categorized links likehttps://www.yourwebsite.com/newsCompared tohttps://www.yourwebsite.com/category_id=123This kind of link can make search engines better understand the page content and also enhance users' trust in the link. When sharing or remembering the link, it is concise and meaningfulurl_tokenIt is also more popular.
How to get the category'surl_token?
To build the category link, you first need to get the correspondingurl_token. There are several ways to easily get this information in Anqi CMS.
When you get the document details through the API (archiveDetail), the returneddataobject will contain acategorysub-object. Thiscategoryobject describes in detail the classification information of the document, including url_tokenfield directly. For example:
"category": {
"id": 1,
"title": "AnqiCMS帮助",
"url_token": "goruning", // 这里的 "goruning" 就是该分类的 url_token
// ... 其他分类信息
}
In addition, when you need to get the category list (categoryList) the API also directly provides each category item withurl_token. Whether you want to display the link to the category of a single document or list all categories in the navigation bar or sidebar, you can obtain the required information in this way.url_token.
The actual operation of building the category link
Nowurl_tokenBuilding the link for the category becomes very direct. You need the root domain of the website, which is configured in the Anqi CMS system settings.BaseUrlFor example, if your websiteBaseUrlIshttps://en.anqicms.comwhile a certain categoryurl_tokenIshelpthen the complete link of that category can be simply concatenated as:
{BaseUrl}/{url_token}
To be specific, 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 Anqi CMS usually adopts this flattened URL structure, that is, categorizedurl_tokenFollowed directly after the domain name. If your website is configured with more complex routing rules, such as in the moduleurl_tokenThen followed by the categoryurl_token(such ashttps://en.anqicms.com/news/industry-news),Then you need to concatenate according to the actual route configuration. But the core idea is to useurl_tokenas part of the URL path.
Summary
make effective use ofcategoryWithin the objecturl_tokenTo build classification links is an important part of AnQi CMS content operation.It not only makes the structure of your website URL clearer and easier to manage, but also directly improves the performance of the website in search engines and the user experience.By simple concatenation, you can create a professional and well-readable category page link.
Frequently Asked Questions (FAQ)
Question:
url_tokenCan it contain Chinese characters or special characters?Answer: Generally speaking,url_tokenIt is recommended to use a combination of letters, numbers, and hyphens (-), avoiding Chinese characters or other special characters. Although some systems may support Chinese URLs, for compatibility, SEO effects, and to avoid encoding issues, standardized English is preferred.url_tokenIs **select. The Anqi CMS also clearly points out in the document that custom URL aliases only support numbers and letters, and it is recommended to follow this rule.Ask: If I change the category of
url_token, will the old link become invalid?Answer: Change the category ofurl_tokenAfter that, the old link will indeed become invalid. In order to avoid users from accessing the 404 error page and the negative impact on search engines, it is strongly recommended that you changeurl_tokenAfter that, immediately set up a 301 permanent redirect on your server. This will direct the old URL to the new URL, ensuring that traffic and ranking are smoothly transferred.Ask: Each category's
url_tokenmust be unique?Answer: Yes, each category'surl_tokenshould be unique under its respective module.url_tokenAs a unique URL alias for the category, if duplicates exist, the system will not be able to correctly parse user requests, leading to inaccessible pages or content confusion. Anqi CMS will strictly require this in its design.url_tokenThe uniqueness, to ensure routing accuracy.