Understanding the friendly URL structure and its importance

Friendly URL structure, usually refers to those URLs that are easy for humans to read and understand, and contain keywords. For example,https://www.example.com/products/category/item-name.htmlfar morehttps://www.example.com/index.php?id=123&cid=456more readable and descriptive.

In content marketing and SEO strategies, a friendly URL structure plays a key role. They help:

  • Enhance search engine visibility: Search engines tend to crawl and index URLs with clear structure and relevant content, which helps improve the ranking of a website in search results.
  • Improve user experienceUsers can quickly understand the page content through the URL, enhance trust, and improve click-through rate.
  • Simplify sharing[en] A concise URL is easier to share on social media, email, or in person.
  • [en] Enhance brand awareness[en] A URL with the brand name or relevant keywords helps to strengthen the brand image.

The 'pseudo-static and 301 redirect management' feature of Anqi CMS provides a solid foundation for these advantages, making the customization of URL structure an important means to enhance website competitiveness.

An overview of pseudo-static rules in AnQi CMS

The AnQi CMS is built with various pseudo-static rule modes, aiming to simplify the URL configuration of the website.In addition to the default provided preset rules such as 'number pattern', 'model naming pattern', and two 'classification naming patterns', the system also offers a highly flexible 'custom pattern'. This is the key to our implementation of personalized friendly URLs.

The "Custom mode" allows us to precisely define the URL structure of different types of pages according to the business logic and SEO strategy of the website, thus breaking through the limitations of preset modes and creating the URL form that best suits our needs.

Configure custom rewrite rules

To start customizing the pseudo-static rules, we need to log in to the background management interface of Anqi CMS and navigate to the 'Feature Management' menu under the 'Pseudo-Static Rule' option.Here, we can select the "Custom Mode" and edit the corresponding rules.

In custom mode, we can configure six groups of rewrite rules, each corresponding to different page types of the website:

  • archiveThe URL rules for the document detail page.
  • categoryThe URL rule for the document list page (category page).
  • archiveIndexThe URL rule for the model homepage (e.g., the homepage for the 'Article' model).
  • page【en】:Single page detail page URL rule (e.g., "About Us" page).
  • tagIndex【en】:Tag homepage URL rule.
  • tag【en】:Tag detail page URL rule.

【en】:Every rule adopts规则名===规则值Configure in the form of 【en】For example:archive===/{module}-{id}.html.

Available rule variables 【en】

When customizing rule values, we can use a series of system-provided variables, combine them, and build meaningful URLs. These variables include:

  • {id}The unique ID corresponding to the content, such as article ID, category ID.
  • {filename}The custom link name of the content, usually automatically generated based on the title or manually set as an alias.
  • {catname}The custom link name of the category, which can also be the pinyin or an alias manually set.
  • {catid}The unique ID of the category.
  • {module}The model table name or URL alias of the content, for example, 'article' or 'product'.
  • {page}Used to indicate the page number of pagination. Please note,{page}The variable needs to be enclosed in parentheses, for example(-{page}), indicating that pagination is displayed only when there is pagination, and custom delimiters can be added before the page number.

Actual Application: Example of building a friendly URL

By combining these variables flexibly, we can create highly optimized URL structures for different parts of the website.

Document details page (archive)

For the document detail page, we typically want the URL to clearly reflect the topic of the article and include keywords. For example, we can use the model name and the custom link name of the document:

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

If the article title is "AnQiCMS Static Optimization" and the model alias is "article", and the custom link name is "anqicms-rewrite-optimization", then the URL will be/article/anqicms-rewrite-optimization.htmlThis is more than/article/123.htmlmore descriptive.

Category list page (category)

The category page serves as the skeleton for content organization, and its URL should also have a hierarchical and descriptive nature. We can combine the model name, custom category link name, and optional pagination information:

category===/{module}-category/{catname}(-{page}).html

If a category name is 'News Dynamic', model alias is 'article', custom link name is 'news', and it is currently the second page, the URL might be/article-category/news-2.htmlIf there is only one page, it is:)/article-category/news.html.

Single page detail page (page)

Single-page pages such as "About Us", "Contact Us", etc., their URLs should be concise and clear, directly reflecting the content of the page:

page===/{filename}.html

If the custom link name of the 'About Us' page is 'about-us', the URL will be/about-us.html.

Tag detail page (tag)

The URL of the tab page helps users and search engines understand the theme aggregated by the page:

tag===/tag/{filename}.html

If the label name is 'SEO optimization' and the custom link name is 'seo-optimization', then the URL will be/tag/seo-optimization.html.

Model homepage (archiveIndex) And the label home page (tagIndex)

The URLs of these pages are usually quite simple:

archiveIndex===/{module}.html(For example}]}/article.html)tagIndex===/tags(-{page}).html(For example}]}/tags.htmlor/tags-2.html)

By the above examples, we can see that the custom pseudo-static rules of AnQi CMS provide great flexibility, which can help us achieve various URL structures that are in line with SEO and user experience.

Important considerations when implementing custom rules

There are several key points to pay special attention to when customizing pseudo-static rules to ensure the normal operation and SEO effect of the website:

URL Uniqueness and Custom Link Name

In AnQi CMS, whether it is documents, categories, single pages, or tags, you can set a "custom URL" or "URL alias".These custom link names must be unique across the entire site.If the manually entered custom link name is duplicated with existing content, the system will automatically add random numbers at the end to ensure uniqueness.Suggest using English lowercase letters and hyphens (-) to create concise, descriptive custom link names.

Maintain Consistency of Rules

Once the pseudo-static rules are determined, it should be maintained as consistent as possible.The frequent change of URL structure may confuse search engines, affecting the inclusion and ranking of the website.If indeed a change is necessary, please ensure to cooperate with the 301 redirect function of the Anqi CMS to permanently redirect the old URL to the new one, in order to retain link weight and prevent traffic loss.

Comprehensively Test All Links

After saving the new URL rewrite rules, be sure to perform a comprehensive test of all links on the website, including navigation menus, internal links, external links, pagination links, and search results pages.Ensure that all pages can be accessed normally and that the URL structure is consistent with expectations.

Server Environment Configuration

The activation of pseudo-static rules usually requires the cooperation of web servers (such as Nginx, Apache).If your website is deployed in environments such as Baota Panel, please make sure that the pseudo-static configuration of Nginx or Apache matches the requirements of Anqi CMS.The installation document of AnQi CMS usually provides example configurations for Nginx or Apache's rewrite rules, ensuring that these configurations are correct is the premise for the rules to take effect.

Concluding remarks

The custom pseudo-static feature of Anqi CMS provides a powerful tool for our website operators, allowing us to flexibly construct URL structures that are friendly to search engines and users.By meticulous planning and rigorous testing, we can not only improve the website's SEO performance, but also provide users with a better browsing experience, thereby gaining an advantage in the fierce market competition.

Frequently Asked Questions

What impact will it have on my website if I change the pseudo-static rules after content publishing?

Can I use Chinese as the link name for custom URLs?

Why did the website URL not change or show a 404 error after I saved the custom rewrite rule?

This could be caused by several reasons.Firstly, make sure that the configuration file of your web server (such as Nginx or Apache) has correctly set up reverse proxy and pseudo-static rules to support the URL rewriting mechanism of the security CMS.The installation documentation for AnQi CMS usually provides corresponding server configuration examples.Secondly, it may be due to the system cache not being updated in time. You can try to clear all the cache in the background 'Update Cache' feature.Finally, please carefully check for any grammatical errors in the custom rules you have entered in the 'SEO Rules' section on the backend. Any minor spelling mistakes or incorrect variable usage can cause the rules to fail.{page}It must be enclosed in parentheses, such as(-{page}).