Home > Article > CMS Tutorial > How to simplify the naming rules of Dreamweaver list and internal page URL
How to simplify the naming rules of Dreamweaver list and internal page URL
What we need to know is that the URL refers to Generally, we will reduce the post path of the internal pages of the site to the shortest. The shorter, the better, which is conducive to search engine inclusion and optimization. Let’s briefly describe where to modify the post path to the shortest way: (recommended tutorial : dedecms tutorial)
1. First, we open Core Website Column Management. After creating the column, click Submit directly without clicking Advanced Options, as shown below:
##2. The red part of the icon above refers to the internal page naming rules and list naming rules, which means that when you publish a post or automatically generate a list, it is automatically generated according to the idea of this rule. Now we understand the meaning of each command in the rules:
{Y}, {M}, {D} year, month and day {timestamp} UNIX timestamp of INT type {aid} Article ID {pinyin} Pinyin article ID {py} Pinyin radical article ID {typedir} Column directory {cc} The date ID is mixed and converted into appropriate letters {page} The page number of the list3. Once you are familiar with its meaning, it will be easier to handle. Now we can omit and delete unnecessary ones generated in the URL path, so that the path can be shortened by manipulation.
When I use DEDECMS to build a website, I am used to omitting the dates in the URL rules for internal pages. The following two lines describe: Default URL rule settings for internal pages ( Default path: {typedir}/{Y}/{M}{D}/{aid}.html) However, the generated internal page path is: //m.sbmmt.com/1/ 2019/11/16/135.htmlIt can be said that it is really too complicated. After personal modification, I omitted the date and modified the original{typedir}/{Y}/{M}{D}/{aid}.htmlin the column. into the following:
{typedir}/{aid}.htmlThen the generated path is: //m.sbmmt.com/1/135.htmlWhen creating a new column, directly follow the specified internal page rules set by yourself. Generate: If you have too many columns, it will be troublesome to modify each one like this. At this time, we only need to modify the php file and then you will automatically create a column according to the rules you set. Let’s open the file
include/common.inc.php Find the following code:
//文档的默认命名规则 $art_shortname = $cfg_df_ext = '.html'; $cfg_df_namerule = '{typedir}/{Y}/{M}{D}/{aid}'.$cfg_df_ext;Modify it to the naming rule you want, just assuming my habits, I Just modify it to:
//文档的默认命名规则 $art_shortname = $cfg_df_ext = '.html'; $cfg_df_namerule = '{typedir}/{aid}'.$cfg_df_ext;After the modification is completed, it will be automatically generated according to this rule when you add columns one by one. When adding columns in batches, they are generated directly according to the specified column rules set by yourself: We open the file dede/templets/catalog_add.htm and find the following code:
{typedir}/list_{tid}_{page}.htmlReplace it Modify it to the following code: (tid refers to the column id number, just omit it if it is not necessary)
{typedir}/list_{page}.htmlAfter this modification, the columns you add in batches in the future will also be automatically generated according to the rules you set. The benefit of simplifying the short post path list path really improves website optimization a lot.
The above is the detailed content of How to simplify the naming rules of Dreamweaver list and internal page URL. For more information, please follow other related articles on the PHP Chinese website!