Home >CMS Tutorial >DEDECMS >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

angryTom
angryTomOriginal
2019-11-16 10:38:332041browse

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:

How to simplify the naming rules of Dreamweaver list and internal page URL

##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 list

3. 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: http://php.cn/1/ 2019/11/16/135.html

It 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}.html

in the column. into the following:

{typedir}/{aid}.html

Then the generated path is: http://php.cn/1/135.html

When 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}.html

Replace 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}.html

After 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn