Applying different URL parsing strategies to different content types such as articles, products, and pages in AnQiCMS is a key step to optimizing website structure, improving search engine friendliness (SEO), and enhancing user experience.AnQiCMS powerful pseudo-static rule management and flexible content model design make this requirement easy to implement.

Basic of content model and URL structure

One of AnQiCMS's core strengths lies in its 'flexible content model'.The system divides the website content into different models, such as the default 'Article Model' and 'Product Model', as well as other models that you can customize according to your business needs.In addition, single-page content also has its independent management mechanism.It is this model-based classification management that lays a solid foundation for us to customize URL parsing strategies.The system can clearly distinguish between whether you are operating an article, a product detail page, or a service page, and apply the corresponding URL rules accordingly.

AnQiCMS URL Parsing Strategy Overview

AnQiCMS includes several types of pseudo-static rules, aimed at meeting the needs of different scenarios.You can find the 'URL Rewrite Rules' setting option under the 'Feature Management' menu in the background.

  1. Digital Mode:The ID number of the content is mainly used in URLs, which is concise but lacks semantics.
  2. Model Naming Pattern:The URL includes the model name, which helps identify the content type.
  3. Category Naming Pattern 1/2:The URL includes the category name, reinforcing the hierarchical relationship of the content.

These preset patterns are convenient, but if you want more fine-grained and SEO-friendly control over the URL structure, 'Custom Pattern' will be your first choice.Custom modes give you the ability to tailor URL structures to different content types.

Deep Customization: Custom URL Parsing Rules

You need to enable the 'Custom Mode' of AnQiCMS to implement different URL parsing strategies for different content types.This allows you to define separate URL structures for each core content type (articles/products, categories, single pages, etc.)

In Custom mode, AnQiCMS provides a series of available variables to help you build logical and semantic URLs:

  • {id}【en】The unique ID of the content.
  • {filename}【en】The custom URL alias of the content, usually the pinyin or manually set English keywords of the content.
  • {catname}【en】The custom URL alias of the category.
  • {module}The URL alias of the content's model (e.g.,)articleRepresents the article model,productRepresents the product model).
  • {page}: Page number (used when the URL contains pagination information).

By these variables, you can freely combine and design URL paths that meet SEO requirements and are easy for users to understand.

Configuration example and explanation:

In the configuration interface of the custom mode, you will see several sets of rules, of which the main ones directly related to articles, products, and pages arearchive/categoryandpage:

  • for articles and products(archiverules):By default, articles and products belong to the "document" category, shared.archiveRules.

    • Semantic URL example: archive===/{module}/{filename}.html
      • {module}will automatically be replaced with the model alias of the content (such asarticleorproduct).
      • {filename}The value will be replaced by the unique alias set in the "Custom URL" field in the background for the article or product.
      • Effect: /article/anqicms-tutorial.htmlor/product/latest-smartphone-model.htmlSuch URLs can indicate the content type and contain keywords, which are friendly to search engines and users.
  • For category pages (categoryrules):The URLs of category pages typically reflect their hierarchical relationships.

    • Semantic URL example: category===/{module}/list-{catname}.html
      • {module}Replace with model alias.
      • {catname}Replace with the alias set in the "Custom URL" field in the background for this category.
      • Effect: /article/list-web-operations.htmlor/product/list-electronics.htmlYou can add it if you need pagination.(-{page})such ascategory===/{module}/list-{catname}(-{page}).html.
  • For single page (pagerules):Single pages such as 'About Us', 'Contact Us', etc., usually require concise and clear URLs.

    • Semantic URL example: page===/{filename}.html
      • {filename}Replace it with the alias set in the 'Custom URL' field of the single page in the backend.
      • Effect: /about-us.htmlor/contact.html

Practical Application: URL Optimization for Different Content Types

In the AnQiCMS backend, setting a 'Custom URL' for each content type is the key to implementing the above strategy:

  1. Articles and Products:When publishing or editing an article/product, find the 'Custom URL' field. The system will automatically generate a pinyin alias based on the title as the default value, but it is strongly recommended that you manually modify it to a more descriptive English alias containing core keywords (for example, for an article titled 'AnQiCMS tutorial', you can set it to)anqicms-tutorialEnsure that this alias is unique throughout the entire site.

  2. Category:When adding or editing a category, there will also be a 'Custom URL' field. Here you can set a concise and representative English alias for your category (for example, for the 'Website Operation' category, you can set it asweb-operations).

  3. Single page:Create or edit a single page in the page management, and set its "custom URL" field. For example, set the "About Us" page toabout-usYou can get/about-us.htmlsuch a friendly URL.

Operation Steps and Precautions

To apply these strategies, please follow the following steps:

  1. Log in to the AnQiCMS backend, go to “Function Management” -> “URL Rewrite Rule”.
  2. Choose "Custom Mode".
  3. According to your needs, edit the URL structure on the corresponding rule line (such as)archive/category/page). Make sure to use the variables correctly and ensure that the path structure is clear.
  4. Save your changes.
  5. Important reminder:After each modification of the pseudo-static rule, be sure to test your website in different browsers or incognito mode to ensure that all links can be accessed normally without any 404 errors.
  6. 301 Redirect:If your website has been online for a while and you are modifying the old URL structure, it is strongly recommended that you use AnQiCMS's '301 Redirect Management' feature to permanently redirect the old URL to the new one.This can effectively avoid the decline in search engine rankings and interruption of user access caused by URL changes.

By using AnQiCMS's flexible URL parsing strategy, you can build logical, semantically rich, and SEO-friendly URLs for various types of content on your website, thereby enhancing the overall performance of the site.