In website operations, the structure of URLs (URLs) has a crucial impact on search engine optimization (SEO) and user experience.A clear, meaningful URL can not only help search engines better understand the page content, but also allow users to expect the page content before clicking, enhancing trust.AnQiCMS as a system focusing on enterprise content management, well aware of this, therefore provides a flexible custom static rule feature.
This article will guide you to understand how to customize the pseudo-static rules in AnQiCMS, thereby optimizing your website's performance in search engines.
The first part: Understanding pseudo-static and its value to search engines
Before starting to customize, let's first understand what pseudo-static is. When you visit a webpage, you will usually see two types of URLs:
- Dynamic URLs:URLs contain question marks (?), equals signs (=), and various parameters, such as
example.com/article.php?id=123&category=news. Such URLs are usually dynamically generated by the server based on the request. - Static URLs:URLs start with
.html/.htmFiles ending with such extensions look like real existing files, for exampleexample.com/news/latest-article.html. - Static URL:It is very similar in form to a static URL, and is usually ended with a file extension, but the content of the page is still dynamically generated by the server.This is the pseudo-static function provided by AnQiCMS.
Why is static URL so important for SEO?
- Search engine friendly:Search engines prefer websites with clear structures and no complex parameters. Static URLs are easier to crawl and index, which helps improve the inclusion rate of the website.
- Keyword display:The static URL allows you to include keywords related to the page content, which provides additional signals to search engines indicating the topic of the page, thereby potentially improving the ranking in relevant search results.
- User Experience:A concise and clear URL is easier to remember and share, and users are also more inclined to click on those that look 'clean'.It increases the user's trust in the website content and makes it easier to judge the content the link may point to.
- Avoid duplicate content:Sometimes dynamic URLs may generate multiple access paths with the same content due to different parameter combinations, which may be recognized as duplicate content by search engines.The static rule can effectively solve this problem, ensuring that each independent content has only one clear access path.
Part two: AnQiCMS built-in pseudo static rules
AnQiCMS has built four commonly used pseudo-static rules for the convenience of users, which can serve as the basic configuration for your website.You can find the 'Static Rules' option under the 'Feature Management' menu in the background.
- Numeric mode:This is a simple and direct pattern, usually using the content ID as the identifier of the URL, for example
/article-123.htmlIt is suitable for websites that do not have special requirements for URL structure, but have relatively weak readability and keyword relevance. - Model naming pattern:This pattern combines the name of the model (such as article, product) to which the content belongs with the custom link name (or ID) of the content, for example
/article/my-great-post.html. For websites that need to distinguish between different types of content, this pattern is more semantically meaningful. - Category naming pattern 1 (ID-based):The URL contains the category ID and the custom link name (or ID) for the content, for example
/news-category/latest-post.html. - Category naming pattern 2 (Name-based):The URL contains a custom link name that includes the category and the custom link name (or ID), for example
/tech/latest-gadget.htmlThese two classification modes emphasize the classification attribution of content, which helps users and search engines understand the hierarchy of the website.
These built-in rules are a good starting point, but in some cases, you may need to finely control every detail of the URL, and that's when you need to customize the static rules.
The third part: Customizing pseudo-static rules step by step
When the built-in rules cannot meet your SEO strategy or brand needs, AnQiCMS provides powerful custom static rules functionality.
1. Enter the custom mode
On the 'Function Management' 'SEO Rule' page, you will see the 'Custom Mode' option. Select it, and the detailed rule configuration area will appear below the page.
Here, you can set up six groups of pseudo-static rules, which correspond to different types of pages within the website: document details, document list, model home page, single page, tag list, and tag details.
2. Understand rule structure
Each custom rule follows规则名===规则值The format. On the left side of the equal sign is the AnQiCMS predefined page type, and on the right side is the structure of the URL you define for that type of page.
For example:archive===/{module}-{id}.html
archive: Represents the document detail page.===: Represents a delimiter./{module}-{id}.html: This is the URL structure you defined.
3. Core rule name and its purpose
The following are the main rule names you can use and customize:
archive: Used for definingDocument detail pagethe URL.- Example:
archive===/{module}/{filename}.html(Will generate like/article/my-first-article.htmlthe URL)
- Example:
category: Used for definingCategory list pagethe URL.- Example:
category===/{module}/{catname}(-{page})(Will generate like/article/news/or/article/news-2/the URL)
- Example:
archiveIndex: Used for definingModel homepagethe URL (i.e., all content lists under a certain content model).- Example:
archiveIndex===/{module}.html(Will generate like/article.htmlthe URL)
- Example:
page: Used for definingsingle pagethe URL (such as "About Us", "Contact Us", etc.).- Example:
page===/{filename}.html(Will generate like/about-us.htmlthe URL)
- Example:
tagIndex: Used for definingTag homepageWebsite (list page of all tags).- Example:
tagIndex===/tags(-{page})(Will generate like/tags/or/tags-2/the URL)
- Example:
tag: Used for definingTag detail pageWebsite (content list under a specific tag).- Example:
tag===/tag/{id}(-{page})(Will generate like/tag/123/or/tag/123-2/the URL)
- Example:
Please note that pagination information in the URL is usually(-{page})to indicate, the brackets are necessary, AnQiCMS will automatically generate or omit this part according to the actual page number.
4. Explanation of available variables.
When defining rule values, you can use the following variables, AnQiCMS will automatically replace them with the actual content:
{id}: The unique ID of the content, for example, article ID, category ID.{filename}Custom link name of the content.This value needs to be manually entered in the 'Custom URL' field during the backend editing of documents, categories, or tags, or generated automatically by the system based on the title.It is the key to achieving SEO-friendly, and you can set it to an English word or pinyin highly relevant to the content topic.{catname}:Custom link name for categories. Also set when editing categories in the background.{catid}Unique ID of the category.{module}:The URL alias of the model to which the content belongs. Defined in content model management.{page}: Page number. This variable must be placed within parentheses, for example(-{page}).
5. How to set a custom link name({filename}/{catname})
This is a place where many users are easily confused.{filename}and{catname}This is not automatically extracted from the title by the system, but manually or automatically generated as an "alias" in the content management background.
- Document (article/product)In the "Content Management" section, when editing a document, you will see a "Custom URL" field.By default, AnQiCMS will automatically generate a pinyin URL based on the document title you enter.
how-to-customize-anqicms-urlThe content of this field is{filename}The value of the variable. - CategoryIn the "Content Management" section, when editing a category, there is also a "Custom URL" field. You can set it to the English name or pinyin of the category (for example:
website-optimization-techniquesThe content of this field is{catname}The value of the variable. - TagUnder the "Content Management" section, when editing a label, there is also a "Custom URL" field, whose function is similar to that of documents and categories.
Ensure these custom link names are unique across the entire site to avoid URL conflicts.AnQiCMS saves data automatically and adds random numbers when necessary to ensure uniqueness.
6. Practical suggestions and precautions
- Step by step test:After modifying the static rule, it is necessary to immediately access the website front-end and check whether the URLs of various page types (home page, article detail page, category list page, single page, etc.) are generated and accessible normally.
- Backup rule:Before performing large-scale customization, it is recommended that you take a screenshot or copy the current pseudo-static rule configuration to prevent any unexpected occurrences.
- Uniqueness:Customize link name (
{filename}/{catname}The core of your SEO-friendly implementation, make sure they are descriptive and unique across the entire site. - 301 Redirect:If your website has already gone live and been indexed by search engines, changing the pseudo-static rules will cause the old URL to become invalid.At this time, you need to use the built-in "301 Redirect Management" feature of AnQiCMS to accurately redirect the old URL to the new URL to retain search engine weight and avoid traffic loss.This is a crucial step in changing the URL structure.