In AnQiCMS,url_tokenis a crucial concept, it is not only a field in the document list, but also the core element of building website friendly URLs (Friendly URL).Understanding its function and usage can help us better optimize the website structure, enhance user experience, and improve search engine rankings.
url_tokenThe role in the document list results
When we obtain the document list through AnQiCMS's API, for example, callingarchive/listEach document data returned by the interface will contain a field namedurl_tokenThe field.This field represents the 'URL alias' or 'Slug' of the document.It is a short, descriptive string, usually derived from the document title or related keywords, and is used to uniquely identify the document.
In the document list results,url_tokenexists, meaning we do not need to rely on the internal document ID (id) to build a link that can directly access the document. It will be originally possiblyyourdomain.com/archive?id=123This address is not friendly to users and search engines, and it is converted toyourdomain.com/news/anqicms-tutorialThis address is more readable and meaningful. At the same time, when we need to obtain specific document details,archive/detailthe interface also allows us to usefilenameParameters (its value is))url_token) to replace the document ID for querying, which greatly enhances the flexibility of the system and the convenience of external integration.
How to make use ofurl_tokenGenerate friendly URLs
AnQiCMS generates friendly URLs, which is centered aroundurl_tokenexpanded.
Firstly, when publishing or editing content, AnQiCMS provides us with customurl_token的能力。When we create a new article, a product, a category, or a tag in the background, the system usually generates a default one automatically based on the title you enter.url_tokenFor example, if the article title is "Safe CMS Content Operation Tutorial", the system may automatically generateanqicms-content-operation-tutorialSuchurl_tokenOf course, we can manually modify it as needed to make it more in line with SEO strategies or brand styles. This customizedurl_tokenThe field supports numbers and English letters, usually recommended to use hyphens (-) to separate words to improve readability.
Onceurl_tokenSet, AnQiCMS will use it as part of the website URL structure for the content item. Specifically, friendly URLs usually adopt域名/模型别名/url_tokenor域名/分类别名/url_tokenThe form of. For example, an article belonging to the "News" model,url_tokenresponse foranqicms-updateThe final friendly URL might be for an article,https://www.yourwebsite.com/news/anqicms-update.
For categories and tag pages,url_tokenThe operation is similar. For example, a category named "Product Center", itsurl_tokenmay be set toproducts, then the URL of the category page might behttps://www.yourwebsite.com/productsWhen the user clicks this link, the system will find the corresponding category page accurately and display the list of contents under it.url_tokenAccurately find the corresponding category page and display the content list under it.
This is based onurl_tokenThe friendly URL mechanism brings obvious benefits.It makes the website URL structure clearer and more logical, not only making it easier for users to understand the content of the page, but also allowing search engine spiders to more effectively crawl and index website information, thereby improving the overall SEO performance of the website.url_tokenThe custom feature, carefully designing the URL alias for each item, making it concise and clear, and containing the core keywords, maximizing the advantages of a friendly URL.
Common Questions (FAQ)
1. If I do not manually seturl_token, How will AnQiCMS handle it?Answer: If you do not manually set while publishing or editing contenturl_tokenAnQiCMS will automatically generate one based on the title of the contenturl_token. The system will attempt to convert Chinese or other non-English characters in the title to pinyin or remove them, and use hyphens to separate them to ensure the generatedurl_tokenis in accordance with URL standards.
2. English for changing published contenturl_tokenWill it affect SEO?Answer: English for changing published contenturl_tokenThis will change the URL address of the content, which indeed will have an impact on SEO.Because the search engine has indexed the old URL, sudden changes may cause the old links to become invalid, thereby potentially losing some traffic and rankings.url_tokenAfter that, set up a 301 redirect (permanent redirect) in time, direct the old URL to the new URL, which can guide search engines and users to access the new address, and pass on the SEO weight of the old link.
3.url_tokenCan it be repeated? For example, are there articles with the same content under different categories?url_token?Answer: Generally speaking,url_tokenIn its respective level and type (such as articles, categories, etc.), uniqueness must be maintained to avoid URL conflicts. But under certain URL routing configurations, such as域名/分类别名/文章url_tokenThis structure, articles under different categories are allowed to be the sameurl_tokenEnglish, because their complete URL paths are different. AnQiCMS ensures that the final generated complete URL is unique, if an attempt is made to create a duplicate at the same level.url_tokenThe system will prompt or automatically add a suffix to distinguish.