Which file path variables are available when customizing the static rules?

Calendar 👁️ 64

Hello! As an old soldier who has been deeply involved in website operation for many years, I know that a flexible and powerful static mechanism is crucial for the search engine optimization (SEO) and user experience of the website.AnQiCMS (AnQi CMS) performs exceptionally well in this regard, it not only provides a variety of ready-to-use pseudo-static modes, but also allows us to deeply customize the URL structure, which undoubtedly provides great convenience for refined operation.

Today, let's delve into how we can flexibly use the key file path variables available in Anqi CMS when customizing pseudo-static rules, and how to cleverly apply them to create more attractive website URLs.


Unlock the secret of AnQiCMS pseudo static: In-depth analysis of the core variables in the URL path

Today, in the increasingly intense digital marketing environment, a website's URL (Uniform Resource Locator) is no longer just a technical address; it is also an important basis for users and search engines to understand the content of web pages and evaluate the structure of the website.A clean, meaningful, SEO-friendly URL that can significantly improve the click-through rate and ranking of a website in search engines.AnQi CMS fully understands this, and its powerful pseudo-static function is precisely designed to meet this need.

The pseudo-static function of AnQi CMS, in short, is to convert dynamically generated page addresses (such as/?id=123&cat=456Rewritten by the server to look like a static HTML file address (for example)/news/technology/anqicms-features.htmlBut the content of the page is still dynamically extracted and rendered from the database.This approach maintains the flexibility of dynamic websites while also having the SEO-friendliness and readability of static URLs.When we need to control the URL structure more finely, the custom static rules provided by Anqi CMS become our powerful assistant.

Core variable parsing: Dynamic elements in the URL path

In the Anqi CMS custom static rule configuration interface, you will see a series of curly braces{}Encapsulated variables. These variables are not fixed characters but are like 'magic placeholders' that will be dynamically replaced by the corresponding content data at runtime.Understanding and properly using these variables is the key to constructing a perfect URL.

Let's get to know these core variables one by one:

  1. {id}: The unique identity of data {id}It is the most basic and commonly used variable, representing the unique numeric ID of any content in the system.Whether it is an article, product, category, or tag, Anqi CMS will assign a unique ID to it.For example, the detail page URL of an article,{id}It will be replaced with the actual ID of the article, such as/article/123.html. When customizing rules, if you want the numerical ID of the content to be included in the URL,{id}is your first choice.

  2. {filename}: Content alias, more descriptive {filename}meansdocument or single pageThe custom link name, usually also called 'slug' or 'alias'. When editing articles or single pages, Anqi CMS will automatically generate a pinyin or English phrase as the default one.filenameYou can also manually modify it. This variable makes the URL more descriptive, so you can directly understand the content of the page by the URL name, for example/products/anqicms-pro.html. Use{filename}Instead{id}Can make the URL perform better in search engines and more user-friendly.

  3. {catname}: The exclusive alias of the categorywith{filename}similar,{catname}Used specifically to representCategoryCustom link name or alias. When creating and editing categories, you can set a unique, meaningful English or拼音 alias for each category. It is referenced in the pseudo-static rules.{catname}Can construct a clear classification path, for example/news/industry-updates/page_1.htmlof whichindustry-updatesis the classificationcatnameThis is very helpful for building a clear website hierarchy.

  4. {catid}: The numeric ID of the classification {catid}As the name implies, it is the unique numeric ID of the category. If you prefer to use the numeric ID in the category URL instead of the alias, or in some special cases you need to include both the ID and the alias to ensure uniqueness,{catid}Could be put into use. For example/category/15.html.

  5. {module}: Model code, distinguishing content typeAnQi CMS supports flexible content models such as article models, product models, etc.{module}The variable represents the current content.Model table nameOr its alias in the URL. For example, the article model may correspond toarticle, the product model may correspondproduct. Through{module}You can easily distinguish different types of content in the URL, such as/article/latest-news.htmland/product/new-arrivals.htmlThis is particularly useful in multi-model websites, making the URL structure more standardized.

  6. {page}The master of pagination.When your content list needs to be displayed with pagination,{page}Variables are particularly important. They will be replaced by the current page number. It should be noted that,{page}variables must be used in pseudo-static ruleswith parentheses()enclosedFor example(/ {page})This means that when the pagination information (i.e., the first page) is not included in the URL, this part of the path will be automatically omitted to keep the URL concise; it will only be displayed when accessing the second page or later pages/page_2Or a similar structure. This is a very elegant way to handle pagination URL processing.

Combination of rules and application scenarios

In the AnQi CMS backend "fake static rules" settings, you can define rules for six different page types, namely:

  • archive: Document detail page (such as articles, product details)
  • category: Document list page (category page)
  • archiveIndex: Model homepage (such as article list homepage)
  • page: Single page detail page
  • tagIndex: Tag homepage
  • tag: Tag document list page

Each rule is followed规则名===规则值The format. For example, if you want the article detail page URL to be/article/文章别名.htmlYou can configure it like this:

archive===/article/{filename}.html

Here are some common examples of pseudo-static rules combined with the above variables, you can adjust them according to your actual needs:

  • Document detail page (e.g., article):

    • /news/{filename}.html(Recommended: Readable, includes keywords)archive===/news/{filename}.html
    • /{module}/{id}.html(General: Suitable for various content models, short path)archive===/{module}/{id}.html
  • Document list page (category page):

    • /{catname}(/{page}).html(Readable, pagination elegant)category===/{catname}(/{page}).html
    • /{module}/{catid}(/{page}).html(Numeric ID, pagination elegant)category===/{module}/{catid}(/{page}).html
  • Model Home (e.g., Product Home):

    • /products.html(Simple and clear)archiveIndex===/products.html
    • /{module}/list.html(General, distinguished by model)archiveIndex===/{module}/list.html
  • Single Page Detail Page (e.g., About Us):

    • /about-us.html(Direct alias, clear)page===/{filename}.html
  • Tag Document List Page:

    • /tags/{id}(/{page})(Numeric ID, pagination elegant)tag===/tags/{id}(/{page})
    • /tag/{filename}(/{page})(Alias, pagination elegant)tag===/tag/{filename}(/{page})

Remember,{page}Variables must be enclosed in parentheses()Enclosed, so that when accessing the first page,/the part of pagination after will be automatically omitted, for example/news/industry-updates/, rather than/news/industry-updates/page_1This can make the URL more concise and standardized.

Practical suggestions and precautions

When configuring custom pseudo-static rules, there are some tips and tricks to share with you:

  1. **Keep it simple and readable

Related articles

How to set up the background to view or modify the specific URL address of the website logo image?

As an experienced website operations expert, I am well aware of the importance of the website logo to the brand image.It is not only the 'front door' of the website, but also a key element for users to identify your brand.In a powerful content management system like AnQiCMS, managing the website logo image address is a fundamental and frequent operation.Today, let's delve into how to easily view or modify the specific URL address of the website logo image through backend settings.

2025-11-06

Where is the actual storage path of these image resources after I upload them to the background?

As an experienced website operation expert, I know the importance of image resource management for website performance, SEO, and even user experience.AnQiCMS (AnQiCMS) has made many meticulous designs in this aspect, allowing content operators to manage these valuable visual assets more efficiently.Today, let's delve deeply into a question that concerns everyone: 'Where are the actual storage paths of the image resources after I upload them to the backend?'}]

2025-11-06

How to distinguish the file path of `config.` for different sites in multi-site configuration?

AnQiCMS (AnQiCMS) is an efficient and flexible content management system, and its multi-site management function is undoubtedly a highlight favored by many operators.However, when it comes to multi-site configuration, some seemingly basic details, such as how to differentiate the `config.` file paths of different sites, often raise questions among users.Today, let's delve into this topic in depth to help everyone clearly understand the configuration logic of AnQiCMS under multi-site architecture.

2025-11-06

How to view the storage path of AnQiCMS log files to troubleshoot program errors?

As an experienced website operations expert, I know that log files play a crucial role behind the stable operation of the system.When your AnQiCMS website encounters a program error, the log file is like a clue in a detective's hands, which can help us trace the cause and specific details of the problem.AnQiCMS is an enterprise-level content management system developed based on the Go language, with a simple and efficient logging mechanism. Understanding the storage path and viewing method of the log files is the first step in troubleshooting program errors and ensuring the healthy operation of the website.

2025-11-06

How to specify the file path of the public code snippet included when using the `include` tag in the template?

As an experienced website operations expert, I know the importance of an efficient content management system (CMS) for website operations.AnQiCMS (AnQiCMS) provides a solid foundation for us to build various websites with its flexibility and powerful template features.Today, let's talk about one of the very practical features that can greatly improve template development efficiency - the `include` tag, especially how the file path is specified when referencing common code snippets, which is often a place where beginners and even experienced developers may feel confused.Why choose to use

2025-11-06

How to view the template file path of the system's default 404, 500 error pages and shutdown prompt page?

As an experienced website operations expert, I know that in the daily operations of a website, we always hope for everything to go smoothly, but unexpected situations are always hard to avoid.Whether it is the user visiting a non-existent page, or the backend server experiencing an occasional failure, or the website needing temporary maintenance, how to elegantly handle these special situations is directly related to user experience and brand image.AnQiCMS is well-versed in this, providing a highly flexible template mechanism to customize these key pages.Today, let's delve into how to find and personalize your 404 in AnQiCMS

2025-11-06

Where is the AnQiCMS scheduled task script (such as `start.sh`) usually stored?

As an experienced website operations expert, I know that the stable operation of every CMS system is inseparable from the silent support of its core components.Today, let's talk about a seemingly simple but crucial file in AnQiCMS - the scheduled task script `start.sh`, where is it hidden, and what role does it play in the daily operation and maintenance of AnQiCMS.--- ### Revealing AnQiCMS: The Hidden Location of the `start.sh` Scheduled Task Script For AnQiCMS users, whether it is for the first deployment or daily maintenance

2025-11-06

Can I view the path of the template file on the server directly through the AnQiCMS background online template editing feature?

As an experienced website operations expert, I am well aware of the importance of template management for website personalization and operational efficiency.AnQiCMS (AnQiCMS) boasts its high efficiency and flexibility, which is favored in the content management field. Its template editing function on the back-end provides great convenience for content operators.TodayUnlocking AnQiCMS Template Path

2025-11-06