Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of simplifying the naming rules of dream list and inner page URL

Shulou Source: shulou.com Published: 2022-06-02 04:51:58 09月19日 Update

This article is to share with you about the list of weaving dreams and the simplification of URL naming rules on the inside page. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

How to simplify the naming rules of dream list and inner page URL

What we need to know is that URL refers to the post path on the inside page of the site. Generally, we will reduce it to the shortest, the shorter the better, which is conducive to search engine inclusion and optimization. Let's briefly describe where we can modify the post path to the shortest way:

1. First of all, we open the core website column management to submit the advanced options of direct point after creating the column, as shown below:

2. The icon red above refers to the inner page naming rules and list naming rules, which means that when you post or automatically generate a list, it is automatically generated according to this rule. Now let's understand the meaning of each instruction in the rule:

{Y}, {M}, {D}

{timestamp} UNIX timestamp of type INT

{aid} article ID

{pinyin} Pinyin + article ID

{py} Pinyin radical + article ID

{typedir} column directory

{cc} date + ID is mixed and converted to appropriate letters

Page number of {page} list

3. It is easy to be familiar with his meaning, and now we can omit the unnecessary generation in the URL path and delete it, so that the manipulation can shorten the path.

When I use DEDECMS to build a site, I used to omit all the dates in the URL rules on the inside page. Here are two lines:

Default URL rule settings on the inside page (default path: {typedir} / {Y} / {M} {D} / {aid} .html)

However, the generated inner page path is: http://php.cn/1/2019/11/16/135.html

It can be said that this is really too complicated. After personal habitual modification, the date is omitted and the original one is changed in the column.

{typedir} / {Y} / {M} {D} / {aid} .html

Modify to the following:

{typedir} / {aid} .html

The path that is generated in this way is: http://php.cn/1/135.html

When you create a new column, it is generated directly according to the specified inner page rule set by yourself:

If you have too many columns, it is troublesome to modify each one like this, then we just need to modify the php file and you automatically create a column according to the rules you set.

Let's open the file include/common.inc.php and look for the following code:

/ / default naming convention for documents $art_shortname = $cfg_df_ext = '.html'; $cfg_df_namerule ='{typedir} / {Y} / {M} {D} / {aid}'. $cfg_df_ext

Change it to the naming convention you want, and assuming my habit, I'll change it to:

/ / default naming convention for documents $art_shortname = $cfg_df_ext = '.html'; $cfg_df_namerule ='{typedir} / {aid}'. $cfg_df_ext

After this modification, it is just that when you add a column, it will be automatically generated according to this rule.

When adding columns in batches, they are generated directly according to the specified column rules set by yourself:

Let's open the file dede/templets/catalog_add.htm and look for the following code:

{typedir} / list_ {tid} _ {page} .html

Modify it to the following code: (where tid refers to the column id number, it is not necessary to omit directly)

{typedir} / list_ {page} .html

After this modification, your future batch add columns will be automatically generated according to the rules you set.

The benefit of simplifying the short post path list path really improves the website optimization.

Thank you for reading! On the dream list, inside the page URL naming rules to simplify the method to share here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Tags: Rules columns inner pages paths generation that is posts articles short code files dates automatic generation methods content meaning done pinyin documents time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Information Apple Microsoft vpn