In website operation, the URL is not only the address of the content, but also the first step for users and search engines to recognize the website.A clear, meaningful, and friendly URL alias that greatly enhances the display effect of content in the browser and achieves better visibility in search results.AnQiCMS provides flexible and powerful features, allowing us to easily customize documents, categories, tags, and even the URL aliases of the pages themselves, thereby optimizing the overall performance of the website.
Why is it so important to customize URL aliases?
Firstly, for search engines, a URL that contains keywords and clear structure can help them better understand the content of the page, which is helpful for improving the ranking of the page in relevant search results.Secondly, for users, a concise and clear URL is not only easy to remember and share, but also allows for an expectation of the page content before clicking, enhancing the user experience.Imagine, a display ofyourwebsite.com/news/how-to-optimize-urlsThe link, is much moreyourwebsite.com/article.php?id=123&category=45is more attractive.
AnQiCMS fully understands this, therefore integrating the URL alias customization feature into all aspects of content.
Customize URL aliases in AnQiCMS
AnQiCMS provides multiple places for us to set and manage URL aliases:
Custom URL for (article/product) documentWhen creating or editing a document, in the "Other Parameters" section of the content editing interface, you will see an option for "Custom URL".AnQiCMS will automatically generate a pinyin URL alias based on the document title, which is usually very good.But if we want to use more SEO-friendly or brand特色的 English alias, we can enter it manually here.For example, an article about "AnQiCMS feature introduction" may be generated by the system
anqicms-gongneng-jieshaoWe can manually modify it toanqicms-features-guideIt should be noted that the custom URL must ensure that it is unique throughout the site. If it is duplicated, the system will automatically add random numbers at the end to ensure its uniqueness.Custom category URLIn managing the website's categories, whether it is article categories or product categories, there will also be a 'Custom URL' field when editing category information.This is similar to the custom way of the document, the system will also automatically generate pinyin aliases based on the category name, and we can also manually modify them.For example, to set the URL of the
gongsi-xinwenis modified tocompany-newsLike the document, the custom category URL also needs to ensure uniqueness.Custom URL for Tag (Tag)The tab page of the website is also an important entry point for users and search engines.In AnQiCMS's document tag management, each tag can also be set to a 'custom URL'.For example, the URL alias of the "SEO optimization" tag can be obtained from
seo-youhuais modified toseo-optimization. The custom URL alias for tags supports letters, numbers, and underscores, and must be unique.Custom URL for a single page.: For "About Us", "Contact Us", and other independent single-page websites, the customization of their URL aliases is also done during page editing. For example, the URL of the "About Us" page can be changed from
guanyu-womenis modified toabout-us.Content Model URL AliasIn addition to the alias of a single content instance (document, category, tag, page), AnQiCMS also provides a 'URL alias' setting at the content model level.This alias is the identifier of the model, which will be used in the pseudo-static rules.For example, the URL alias of the article model is default to
article, Product Model isproduct. It is usually recommended to use short English lowercase letters.
The key to enabling custom URL alias: pseudo-static rules
Although we have set up beautiful URL aliases in the background, in order to make them truly display and accessible on the front end, we still need to rely on the pseudo-static rules of AnQiCMS. The pseudo-static feature can convert dynamically generated URLs (such as?id=123Converted to look like static files (such as).htmlending into a more friendly URL.
AnQiCMS is built-in with various pseudo-static rule patterns, such as 'number pattern', 'model naming pattern', and 'category naming pattern'.These patterns have already met the needs of most websites, making it convenient for us to select with one click.However, if we want to make full use of the custom URL alias, we must select and configure the 'custom mode'.
Under the "Custom mode", we can flexibly combine various variables to construct URL structures. The core variables include:
{id}: The unique ID of the content{filename}Custom URL alias for document, single page setting{catname}Custom URL alias for category setting{module}URL alias for content model{page}Page Number
To make custom{filename}and{catname}take effect, make sure they are included in the custom static rule. For example, if you want the article URL format to be/{module}/{filename}.htmlThen you can set it like this in custom rulesarchive===/{module}/{filename}.html. So, the custom URL alias you enter in document editing will replace the original ID or pinyin and appear in the final URL.
Practical Tips for Optimizing URL Aliases
- Concise and Descriptive: URLs should be short and accurately describe the page content. Avoid long and unnecessary words.
- Contains keywordsIn URL aliases, naturally integrate core keywords, but avoid keyword stacking. This helps search engines understand content relevance.
- Use hyphens to separate wordsAlways use hyphens (
-) to separate words in URLs, not underscores (_) or spaces. For example,best-practicesis preferredbest_practices. - Maintain consistencyThe entire website's URL structure should be consistent. For example, if articles use
/blog/, products use/products/, this rule should be followed. - Avoid special characters: Avoid using special characters other than hyphens in URLs to ensure readability and compatibility.
- Make good use of 301 redirectsIf the website content or structure changes, the old URL may become invalid.AnQiCMS has built-in powerful 301 redirect management features that can help us effectively avoid traffic loss and SEO weight decline, permanently redirecting old URLs to new ones.This is an indispensable part of URL optimization strategy.
By providing these meticulous custom features and flexible pseudo-static configuration through AnQiCMS, we can build URL structures that are beneficial for search engine crawling and enhance user experience, thereby laying a solid foundation for the successful operation of the website.
Frequently Asked Questions (FAQ)
Q1: Why did I set a custom URL alias, but it didn't take effect on the front end?A1: The most common reason is that the pseudo-static rules are not configured correctly or are not enabled..{filename}or.{catname}Variable. Please go to the "Function Management"->"Static Rule" in the AnQiCMS backend and confirm that you have selected the "Custom Mode" and check the corresponding document (archive)、Category(category) or page (page) was used in the rule{filename}or{catname}Variable. For example, if you want to enable the custom URL of the article, yourarchiverule may need to be set toarchive===/{module}/{filename}.html.
Q2: How to deal with the system prompt 'The alias already exists' when customizing the URL alias?A2: AnQiCMS requires that URL aliases be unique across the entire site.This means you cannot have two documents, two categories, or two pages using the same alias.If you encounter this prompt, you can try choosing a different, more distinctive alias, or adding a number or a brief modifier (such asyour-title-2oryour-title-guide) to ensure its uniqueness.
Q3: Will the previous link become invalid after modifying the URL alias of an existing article? Will it affect SEO?A3: Yes, after modifying the URL alias of an existing article, the previous old links will become invalid, and users and search engines will not be able to access the content through the old links. This will have a negative impact on the website's SEO and may result in a drop in rankings.To avoid this situation, you should immediately set up a 301 permanent redirect to the new URL in the 'Function Management' -> '301 Redirect Management' section of the AnQiCMS backend.This will automatically redirect search engines and users to the new link when they access the old link, thus preserving the SEO weight of the page.