How to use `{filename}` or `{catname}` in pseudo-static rules to generate SEO-friendly custom URLs for articles, categories, and single pages?

Calendar 👁️ 57

In website operations, generating SEO-friendly URL addresses for content is a key link to improving website SEO performance.A clear, keyword-rich URL not only allows users to understand the page content at a glance, but also helps search engines better understand and crawl web pages.AnQiCMS provides powerful custom static rule functionality, allowing us to make full use of{filename}and{catname}Variables that generate highly customized URLs for articles, categories, and even single pages.

Optimize URLs, starting with understanding pseudo-statics.

Static page by default, as the name implies, is to 'disguise' the dynamic URL through the server rules to the form of a static HTML page.The benefits of doing this are obvious: search engines prefer simple, stable, and unchanging static URLs, which helps them index website content more effectively and may improve page rankings.Users are also more likely to click on URLs that are easy to read and contain meaningful keywords.The Anqi CMS is built-in with various static rule patterns, ranging from simple number patterns to more SEO-valuable model naming and classification naming patterns.However, if you want to maximize the customization and SEO-friendliness of the URL, the custom mode is undoubtedly the best choice.

Core variables:{filename}with{catname}usefulness

In AnQi CMS, the custom pseudo-static rules include,{filename}and{catname}are two very important variables that give us the ability to inject keywords into URLs:

  • {filename}This variable represents the 'custom URL' for articles, single pages, or tags.When you edit an article, create a single page, or manage tags, you will find a "Custom URL" field.By default, the system will automatically generate a pinyin URL based on the title, for example, “Anqi CMS Tutorial” may automatically become “anqicms-jiaocheng”.Of course, you can manually modify it according to your actual needs to include more targeted keywords.It should be noted that this custom URL must be unique throughout the entire site. If there is a duplicate, the system will automatically add numbers at the end to ensure its uniqueness.
  • {catname}This variable is specifically used for the category page, representing the 'custom URL' of the category.When you add or edit a category, there will also be a 'Custom URL' setting item.The logic and importance of its generation and{filename}Similar, aimed at making the category page URL directly reflect its content theme.

The cleverness of these variables lies in their ability to directly reflect the meaningful keywords you set in the background for specific content (articles, categories, etc.) in the URL structure, greatly enhancing the readability and SEO value of the URL.

Step by step to configure custom static rules

We need to go to the "Function Management" menu in the Anqi CMS backend to find the "Static Rules" option to make good use of these two variables.In here, you can select the "Custom Mode".

In custom mode, we can configure six groups of rules, each corresponding to different types of pages: document details (archive), document lists(category), model home page (archiveIndex), single page (page), tag list(tagIndex) and tag details(tag)。Every rule is followed规则名===规则值format.

Here are some uses of{filename}and{catname}Variable to create an SEO-friendly URL example:

  1. Article detail page (archive): Usually, we hope the article URL contains the name of its category and the keywords of the article itself. You can set it like this:archive===/{catname}/{filename}.htmlThis way, your article URL might be:/wangzhan-yunying/anqicms-jiaocheng.htmlIt is clear and contains key words.

  2. Category list page (category): The URL of the category page can only contain the custom name of the category itself. You can set it like this:category===/{catname}(-{page}).htmlHere(-{page})Is an optional pagination variable, when the list has multiple pages, it will automatically generate such/wangzhan-yunying-2.htmlPagination URL. The URL of a single category page will be/wangzhan-yunying.html.

  3. Single page detail page (page): For single-page pages like 'About Us' and 'Contact Us', use their custom URL aliases directly. You can set it up like this: page===/{filename}.htmlThis is where your single-page URL will be/about-us.htmlor/contact-us.html.

  4. Tag detail page (tag): The URL of the tab can also be directly used with the custom name of the tab. You can set it like this:tag===/tags/{filename}(-{page}).htmlSuch, a tab URL about 'SEO optimization' might be/tags/seo-youhua.html.

After configuring these rules, save the changes, your website will start using these new URL structures.But remember, it is not enough to configure the rules, you also need to fill in meaningful keywords in the 'custom URL' field when creating or editing content.

Manage the custom URL of the content

In the Anqi CMS backend content editing interface, whether it is articles, products under 'Publish Documents', or single pages in 'Document Categories', 'Document Tags', and 'Page Management', there is a 'Custom URL' field.

  • article/product/tag/pageIn their edit page, find the 'Custom URL' field.The system will automatically generate pinyin based on the title, but to maximize SEO effects, it is recommended that you manually modify it according to the core keywords of the page content, keep it concise, relevant, and connect words with hyphens (-).For example, an article about the 'AnQi CMS pseudo-static configuration', you can manually set the custom URL toanqicms-rewrite-config.

  • CategoryIn the editing page of 'Document Classification', find the 'Custom URL' field. Similarly, you can set it based on the core keywords of the category name, for example, a category named 'Website Operation' can be set towebsite-operation.

Make sure these custom URLs are unique, as the system will automatically handle duplicates, but manually maintaining their uniqueness and semanticization is more beneficial for SEO.

**Practice and Precautions

  • Simple and clear: The shorter the URL, the better, while also accurately conveying the page content.
  • Contains keywords: Appropriately incorporating core keywords into the URL without堆积 can help enhance relevance.
  • Use a hyphen (-)Use a hyphen (-) instead of an underscore (_) to separate words in a URL, which is recommended by search engines.
  • Maintain consistency: Once the URL structure is determined, do not change it frequently, otherwise it may affect the inclusion and ranking of search engines.
  • Using 301 redirectIf indeed it is necessary to change the URL structure of the collected pages, the 301 redirect management function provided by Anqicms is particularly important.It can transfer the weight of the old URL to the new URL, minimizing SEO loss as much as possible.

By using the above method, you can fully utilize the pseudo-static function of AnQi CMS to build a set of beautiful and SEO-friendly URL systems for your website, thereby gaining an advantage in the fierce online competition.


Frequently Asked Questions (FAQ)

  1. Ask: Does the 'Custom URL' field of Anqi CMS support Chinese? What will happen if I enter Chinese?Answer: Although the 'Custom URL' field of Anqi CMS can accept Chinese input, the system usually automatically converts it to the corresponding pinyin form (for example, 'Anqi CMS' becomes 'anqicms') for friendlier URLs for search engines.If you want the URL to include specific English keywords instead of pinyin, it is recommended that you enter English and hyphens manually, which can better control the SEO effect of the URL.

  2. Ask: I have modified the static rules, but some old URL links still exist on the website. Can they still be accessed? Will this affect SEO?Answer: After modifying the static rules, the old URL usually cannot be accessed directly, which may cause a large number of 404 errors, seriously affecting the website's SEO.In order to avoid this situation, Anqi CMS provides a 301 redirect management function.You should redirect all old URLs to the new URL address with 301.301 redirect tells search engines that the page has been permanently moved, thereby passing the weight of the old URL to the new URL, and minimizing the impact on SEO.

  3. Ask: What will the system do if I do not fill in the 'Custom URL' field when editing an article or category?Answer: If you have not manually set the 'Custom URL' field, AnQi CMS will automatically generate the corresponding pinyin as the URL alias based on the content title.If the generated phonetic is duplicated with other content's URL, the system will automatically add a string of numbers at the end of the URL to ensure its uniqueness.Although this automatic generation method can ensure the availability of the URL, but for the SEO effect and readability, it is still recommended to manually edit the custom URL to include core keywords and keep it concise.

Related articles

How to set up image resource management in AnQi CMS and support batch regeneration of thumbnails in different sizes?

In website operation, images are not only an important part of the content, but also a key factor affecting page loading speed and user experience.Efficient image management can greatly enhance the performance and maintainability of a website.AnQiCMS (AnQiCMS) is well-versed in this field, providing users with comprehensive image resource management functions, especially excelling in thumbnail settings and batch processing, making image operations more convenient and flexible.### Core Feature Overview: AnqiCMS Image Management System AnqiCMS Image Resource Center is a collection of upload, classification, editing

2025-11-08

How to reuse common HTML fragments in a template by using the `include` tag or define reusable code blocks by `macro`?

In the development and maintenance of website templates, we often encounter the need to reuse HTML code snippets or logical structures.If you always copy and paste, it is not only inefficient, but also once you need to modify it, you have to repeat the operation in multiple places, which is very prone to errors.AnQi CMS knows this point, it provides a template engine that adopts Django's syntax, through `include` tags and `macro` macro functions, allowing us to easily achieve code reuse, greatly enhancing the maintainability and development efficiency of templates.### Reuse the public HTML fragment: `include`

2025-11-08

How to retrieve and display user group details, such as group name, level, and purchase price, for a membership system?

Today in the operation of the website, building an efficient member system is crucial for content monetization, user stickiness cultivation, and community construction.AnQiCMS (AnQiCMS) provides a solid foundation for building such a system with its flexible design and rich features.Among them, the fine management of user groups is the core of the member system's operation, which allows us to provide differentiated service experiences based on the different identities and rights of users.### User Group Management in AnQi CMS: Basics and Value AnQi CMS built-in user group management function

2025-11-08

How to automatically parse URL strings to clickable `<a>` tags in the article body or description?

In daily website content creation and management, we often need to embed some links in the article body or description, such as referencing external resources, pointing to product pages, or other related articles.If these URLs are only displayed in plain text, users will have to manually copy and paste them into the browser, which undoubtedly will greatly reduce their user experience.幸运的是,AnQiCMS 内置了非常实用的功能,可以自动将这些 URL 字符串智能识别并转换为可点击的 `a` 标签,让网站内容更加友好和便捷。This function mainly through

2025-11-08

How to display the current year or a custom formatted current date and time in the template?

## In Anqi CMS template, flexibly display the current date and custom time format In website operations, we often need to display date and time information dynamically on the page, whether it is the current year in the copyright statement, the publication time of articles, or the countdown of activities.The AnQi CMS provides a very flexible and easy-to-use method to display the current year or a custom date and time format in templates, keeping your website content up to date and enhancing user experience.The Anqi CMS template system adopts syntax similar to the Django template engine, making the display of dynamic content intuitive

2025-11-08

How to split a string into an array or concatenate array elements into a single string in a template?

During the development of Anqi CMS templates, we often encounter situations where we need to process strings, such as converting a text segment separated by a specific symbol into a list, or concatenating multiple items in a list into a continuous text.The Anqi CMS template engine provides powerful filters (Filters) to help us easily implement these operations, greatly enhancing the flexibility of the template. ### AnQi CMS Template Engine Basics The AnQi CMS template engine syntax is designed to be very user-friendly, similar to the Django template engine.It is mainly through double curly brackets

2025-11-08

How to find the number of occurrences or the first occurrence position of a keyword in a string on a line in a template?

In AnQi CMS template design, sometimes we may need to perform more detailed analysis and display of content, such as finding the position of the first occurrence of a specific keyword in a text, or counting how many times it appears.These requirements are very practical in aspects such as dynamic content display, information extraction, or辅助SEO.Benefiting from the template engine syntax similar to Django adopted by Anqi CMS, we can utilize its powerful filter functions to achieve these goals.Next, we will discuss how to use the built-in `index` and `count` in Anqi CMS template

2025-11-08

How to safely escape HTML code in a template to prevent XSS attacks, or force non-escaping of HTML content?

When building a website, ensuring the security of the content, especially the prevention of cross-site scripting (XSS) attacks, is a crucial aspect.AnQiCMS (AnQiCMS) provides powerful tools at the template level to manage the escaping of HTML content, thereby effectively protecting the website and its users.Understanding how to safely handle HTML code in templates is essential knowledge for every AnQi CMS user when performing content operations and template development.### Default security mechanism of AnQi CMS template The template engine of AnQi CMS adopts a design philosophy similar to Django

2025-11-08