Dream Dedecms use $cfg_arcdir to optimize the location of document saving and naming rules optimization

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

In the use of Dede to build a station friends know, optimize the document path, the shorter the better, I believe many know how to modify, there are many articles for reference.

Add some here this morning.

Use the $cfg_arcdir automation to modify the path. Never found a tutorial on the Internet. So your own research has come to the following methods:

In order to reduce future problems, it is recommended that you save the document in a separate folder rather than in the document column.

For example: Document with Document ID 1

There can be two forms of

1.http://www.xxxxx.com/mulu/1.html

2.http://www.xxxxx.com/html/1.html

Where Mulu is the document's Column folder.

If you move this document later, you will change the path, which has a great impact on SEO.

Therefore, it is recommended that the document be stored separately in a folder in the form of 2.

How to achieve it?

Now, let's do it.

There are many ways, online also have a lot of tutorials, I am talking about the method I use.

Modification: common.inc.php

Locate the default naming convention for a document

Change to the following form

Default naming rules for documents

$cfg _arcdir=str_replace ("/", "", $cfg _arcdir)//This removes the document HTML default save path: "/" appears in to prevent errors

$art _shortname = $cfg _df_ext = '. html ';

$cfg _df_namerule = $cfg _arcdir. /{aid} '. $cfg _df_ext;//here Call the path above to facilitate management.

Description: Where $cfg_arcdir can be set directly in the background, as shown in figure:

  

The advantage of this approach is that if you want to change the path in the background to modify directly, without changing the code again, more convenient.

Of course, the rapid creation of columns to be modified, according to the above ideas can be achieved.

Quick Create column Reference code:

<input name= "Namerule" type= "text" id= "Namerule" value= "<?php Echo str_replace ("/"," ", $cfg _arcdir);? >/{aid} . html "size=" 40″/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.