In the daily use of Anqi CMS, we often come acrossurl_tokenthis field, especially when dealing with document details and URL structures. It is related to the API interface infilenameParameters are closely linked, understanding the relationship between them is crucial for better management of website content, optimizing user experience, and improving search engine performance.
url_token: A 'friendly' identity tag for content
url_tokenIn simple terms, it is a 'URL alias' set for various contents (such as documents, categories, single pages, tags, etc.) in the Anqi CMS system.It is not the internal ID of the content, but a more readable and descriptive string used to generate user and search engine friendly links on the website front end.
Imagine if the link to your website article was like this: yourwebsite.com/article?id=12345It is difficult for users to obtain any valuable information from this link, and search engines are also unable to determine its topic. But if it hadurl_tokenYou can set it toyourwebsite.com/article/anqicms-features. Such links are clear and easy to understand, convenient for users to share, and are also a key part of search engine optimization (SEO).Search engines prefer URLs that contain keywords and are well-structured, which helps improve the ranking of content in search results.
url_tokenThe field allows you to customize these aliases, usually recommended to be set as a combination of pinyin or English words related to the content title, concise and meaningful.This field can be manually filled in when content is published, or it can be automatically generated by the system based on the title.It stores the external identifier of the content internally, which is an important component of content accessibility.
filename: A convenient 'index' for searching content
filenameIs a frequently occurring request parameter in the Anqi CMS API interface, such as in obtaining document details (/api/archive/detail), category details (/api/category/detail), single page details (/api/page/detail)or label details(/api/tag/detail)and you will find this parameter. Its role is to serve as a convenient 'index' for retrieving specific content.
According to the document description, when requesting content details, you can choose to enter the contentid(internal identifier), or choose to enterfilename. Here,filenameThe parameter is used to receive the one you have set in the contenturl_tokenThe value. That is to say, if you have set a documenturl_tokenFor "anqicms-beginner-guide", when callingarchive/detailthe interface, in addition to usingid=某个数字, you can also use directlyfilename=anqicms-beginner-guideAccurately obtain all the information of this document.
url_tokenwithfilenameClosely related
Now, their relationship should be clearer.url_tokenIs a 'friendly' name inherent in the content, reflecting its manifestation in the public URL; andfilenameThis is the parameter used to specify the 'friendly' name when we retrieve these contents through the API interface.filenameThe parameter is actually a reference or query method forurl_tokenthe field value.
This design brings great flexibility:
- User experience optimizationThe URL displayed on the website's frontend is based on:
url_tokenGenerated, more readable and user-friendly. - SEO-friendly: A friendly URL structure helps improve the search engine's ability to crawl and understand content.
- Convenient API access: Developers can use more readable when calling the API.
filename(i.e.),url_tokenValues) to replace numeric IDs, making debugging and management more intuitive. - Content recognition diversity: AnQiCMS allows you to use internal IDs or
url_token(as afilenameParameters to locate content, meeting the needs of different scenarios.
In summary,url_tokenIt is one of the core metadata of AnQi CMS, which determines the style of your content as a "business card" on the Internet; whilefilenameParameters are used to take advantage of this "business card" to accurately locate and access content. Rational planning and useurl_tokenwill bring better website access experience and higher network visibility.
Frequently Asked Questions (FAQ)
1. If the content is not manually set when publishedurl_tokenHow will the system handle it?The Anqi CMS usually has a default mechanism to handle this situation. It is likely to automatically generate one based on the title of your content.url_tokenFor example, convert Chinese titles to pinyin or English abbreviations. Although the system will try its best to generate them, manually setting a concise, meaningful, and unique one is recommended.url_tokenIt is usually better to do so, which can better meet your SEO and brand display needs.
2. Multiple contentsurl_tokenCan they be the same? If they are the same,filenamehow will the parameters work?In theory, in order to ensure the uniqueness of URLs and the precise retrieval of content,url_tokenAvoid repetition. If there is a repetition, the system may automatically add numbers or other identifiers to distinguish, or pass through the APIfilenameWhen searching for parameters, only the first match will be returned, which may not be the result you expect. Therefore, it is recommended that you seturl_tokenEnsure its uniqueness within the content type (such as documents, categories, etc.).
3. Change the published content.url_tokenWhat impact will it have on the website?Change a website that has already been launched and indexed by search enginesurl_tokenThis will directly cause the original URL to become invalid. This may lead to two main problems: first, when users click on the old link, they will see a 404 error page, which seriously affects the user experience;The search engine will find a large number of 'dead links', which will affect the website's SEO ranking.If indeed a change is required, it is essential to set up a 301 permanent redirect, redirecting the old URL permanently to the new URL to retain the original SEO weight and ensure uninterrupted user access.