AnQiCMS (AnQiCMS) as an efficient, customizable and extensible content management system, its flexible content model and powerful pseudo-static function provides great convenience for website operators. When dealing with multi-content model websites, how to cleverly use the pseudo-static rules in{module}Variables are the key to achieving excellent SEO effects and user experience.
In AnQiCMS, each content model (such as articles, products, services, etc.) can be assigned a unique 'URL alias' in the background.This URL alias is the identifier for the model in the front-end URL path.{module}Variable, it is used to dynamically capture and insert this URL alias.This means that regardless of how many content models your website has, you can define a set of generic static rules, and AnQiCMS will automatically fill in the correct model alias based on the actual content type displayed, thus generating a clear and search engine-friendly URL.
Understanding the content model and URL aliases of AnQiCMS
One of the core strengths of AnQiCMS lies in its flexible content model design.Operational personnel can customize various content types according to business needs, such as the "article model" for news and information, the "product model" for displaying product information, the "event model" for publishing event announcements, and so on.Each custom model must set a "model table name" (a database-level identifier) and a crucial "URL alias" when it is created.articleThe URL alias for the "Product" model can beproduct. It is this URL alias that became part of the static rule{module}The replacement value of the variable
{module}The role of the variable in the static rule
The rule of static pseudo is a tool for optimizing website URLs (i.e., URL rewriting), which converts dynamically generated URLs containing parameters into static, readable URLs. For example,example.com/view.php?type=article&id=123Can be rewritten asexample.com/article/123.htmlIn AnQiCMS,{module}The variable plays the role of a dynamic placeholder in this process.
When a user accesses a certain content on a website, AnQiCMS identifies the content model to which the content belongs and extracts the URL alias of the model. Subsequently, when constructing or parsing URLs based on predefined pseudo-static rules, {module}The variable will be replaced with this URL alias.This mechanism ensures that even if the website has various types of content such as articles, products, and cases, they can all clearly reflect their categories in the URL without needing to write redundant pseudo-static rules for each type of content.
{module}An example of variable actual application
In the AnQiCMS background "Static rules" settings, you can define URL structures for different page types. The following are some combinations{module}Common application scenarios of variables:
Document detail page(
archiveRules): Usually used in detail pages of articles, products, services, and specific content. You can define rules like this:archive===/{module}/{filename}.htmlOr:archive===/{module}-{id}.htmlIf the alias of the 'Article' model's URL isarticle, ID is 123, and the custom link name isseo-guideThe URL of the article may be generated as/article/seo-guide.htmlor/article-123.html. If the URL alias of the "Product" model isproduct, the ID is 456, and the custom link name isproduct-a, the URL will be/product/product-a.htmlor/product-456.html.Category list page (
categoryRules): The category list page is used to display the content list under a certain category. The rule definition can include{module}to specify which content model the category belongs to:category===/{module}/{catname}(-{page})For example, the URL alias of the "SEO optimization" category under the "Article" model isseo-optimizationThen, the URL of the category list page might be/article/seo-optimization/(First page) or/article/seo-optimization-2/(Second page).The model homepage (
archiveIndexRules): Each content model typically has a main list page or homepage. Use{module}to directly point to the root path of this model:archiveIndex===/{module}.htmlThis will generate for the "article" model/article.html, and for the "product" model/product.htmlWait for the URL.
By this means,{module}The variable plays a powerful dynamic adaptation role in pseudo-static rules, enabling content under different content models to have exclusive and structured URLs, greatly enhancing the website's SEO performance and users' understanding of the website structure.
**Practice and Precautions
- The consistency and readability of URL aliases:Choose concise, descriptive URL aliases for your content model. For example, use
articleinstead ofdoc, usingproductinstead ofitem. Maintaining consistency in aliases helps users remember and for search engines to understand. - Optimize the URL by combining with other variables:
{module}It is usually combined with other variables (such as{id}/{filename}/{catname}) for use. For example,/{module}/{filename}.htmlThan/{module}/{id}.htmlBe more descriptive because{filename}Usually contains keywords, which helps with SEO. - Avoid URL conflicts:Ensure that the static rules you set will not conflict with the actual paths of other pages or internal system paths, especially when using custom URL aliases.
- 301 Redirect Management:If you decide to change the URL alias or URL rewrite rule of the content model, please make sure to use the built-in 301 redirect function of AnQiCMS.This helps to redirect the old URL traffic to the new URL, avoiding traffic loss and SEO penalties.
- Test all content types:After modifying the pseudo-static rules, be sure to comprehensively test the document detail pages, category list pages, and model homepage under all content models to ensure that all URLs can be generated and accessed correctly.
By analyzing AnQiCMS in{module}A deep understanding and effective application of variables, website operators can build a flexible and powerful URL structure for multi-content model websites, which can not only significantly improve the friendliness of search engines, attract more natural traffic, but also provide users with a more intuitive and convenient browsing experience.
Frequently Asked Questions
If I change the URL alias of the content model, what impact will it have on the website?
Changing the URL alias of the content model will directly change all usages of{module}The pseudo-static URL path of the variable.This means that if the old URL is not handled properly, the page links previously indexed by search engines will become invalid, and users accessing through the old links will encounter a 404 error, leading to traffic loss and a decrease in SEO rankings.Therefore, after changing the URL alias, it is necessary to configure the corresponding 301 redirect rules in the AnQiCMS backend to permanently redirect the old URL to the new one, in order to preserve SEO value and user experience.
Except for the document detail page and category list page,{module}What types of pages can the variable be used for?
Defined by the AnQiCMS pseudo-static rule,{module}Variables can usually be applied to the following types of pages:archive(Document detail page),category(Category list page),archiveIndex(Model home page). This means that you can use{module}Define clear URL structures for your article list, product list, and root directories of these content types. For single-page (page) and tags (tag/tagIndex) etc., AnQiCMS usually uses{filename}/{id}Variables directly define their URL, not too dependent{module}Variables, because they do not directly belong to a specific content model.
How to ensure that the URLs generated by different content models are unique and do not conflict with each other?
AnQiCMS'{module}The variable design is intended to distinguish different content types by introducing model aliases in the URL.The key to ensuring the uniqueness of URLs is: first, set a globally unique URL alias for each content model.{module}Also, combine{id}or{filename}and other variables. For example,/{module}/{filename}.htmlIt can effectively avoid conflicts because even if the titles of two different models' documents are the same, their model aliases are different, or the documents themselves arefilenameDifferent, it will also generate a unique URL. The AnQiCMS system generates it automaticallyfilenameIt will also ensure that it is unique under the current model and category.