Pseudo-static combat: Dream cms set in Apache three-step walk

Source: Internet
Author: User
Tags aliyun apache change cms dedecms directory document file

Intermediary trading http://www.aliyun.com/zixun/aggregation/6858.html"> SEO diagnostic Taobao customer hosting technology hall

Recently, my friends found that the space used to make web sites is growing, and found that to update the document, it takes half an hour to think: Is there any way to be simpler, the change is seen, that is more convenient what. However, the original choice weaving dream, is optimistic about its static pages, fast, do not want to use dynamic pages, but now we must study some, and finally found a weaving dream pseudo-static method, without waiting for a long time to update, a5 starter, share with friends. Well, start our weaving dream pseudo-static settings, divided into three steps:

The first step: check whether your space supports pseudo-static rules, if it is a virtual host, you can ask the host business customer service, if it is vps and server, then do it yourself.

First, save the following pseudo-static rules.

Here's an example of an Apache server:

Apache server pseudo-static needs in the root directory of the. Htaccess file to join the pseudo-static rules can be.

Open .htaccess file, add the following rules:

# Provide some rules for reference

RewriteRule ^ category / list - ([0-9] +) \. Html $ /plus/list.php?tid=$1

RewriteRule ^ category / list - ([0-9] +) - ([0-9] +) - ([0-9] +) \. Html $ /plus/list.php?tid=$1&totalresult=$2&PageNo = $ 3

RewriteRule ^ archives / view - ([0-9] +) - ([0-9] +) \. Html $ /plus/view.php?arcID=$1&pageno=$2

If there is no. Htaccess, to create an empty document with their own text, write it yourself, save it as. Htaccess, remember to upload to the root directory.

The second step, weaving dream background settings

1, log in the dream of the background, to the "background - system parameters - the core set - whether to use pseudo-static" and select "yes" that we open in the background pseudo-static;

2, create a column or batch increase column, column list options: select "dynamic page"; add new articles, release options: select "view only dynamic."

3, if your site has generated a static column or article HTML, you need to turn off the generation of static pages, the background-system-SQL command line tool to execute the following statement: update dede_archives set ismake = -1; update dede_arctype set isdefault = -1; (These two commands make a static page into a dynamic page, so that the static part of the column into a dynamic section is pseudo-static key two steps, of which, dede is your installation of 6184.html " > Data table prefix, according to the actual situation to replace.)

The third step, other manual settings

1, delete the site index.html root directory, you can not update the home page HTML, of course, you can also choose not to use the dynamic home page.

2, DedeCms V5.7 as an example, open / include / help / channelunit.helper.php.

GetFileName () in the following code:

// dynamic article

if ($ cfg_rewrite == 'Y')

{

return $ GLOBALS ["cfg_plus_dir"]. "/ view -". $ aid .'- 1.html ';

} With

// dynamic article

if ($ cfg_rewrite == 'Y')

{

return "/archives/view-".$aid.'-1.html ';

}

2, GetTypeUrl () in the following code:

//dynamic

$ reurl = $ GLOBALS ['cfg_phpurl']. "/ list.php? tid =". $ typeid; Replace with

//dynamic

$ reurl = "/category/list-".$typeid.".html"; This step must be modified by changing your channel or list page URL to /category/list-1.html.

3, DedeCms list page pseudo-static

Open /include/arc.listview.class.php and find the GetPageListDM () function that gets the dynamic paging list at the end:

$ plist = str_replace ('. php? tid =', '-', $ plist); Replace with

$ plist = str_replace ('plus', 'category', $ plist); // Replace the default plus with category

$ plist = str_replace ('.php? tid =', '-', $ plist); Modify the default page link list format /plus/list-1-2-1.html to / category / list-1-2- 1.html, this step can not be changed.

Reminder: 1, if it is pseudo-static dream weaving other types of columns, the basic principle is the same, such as Q & A module columns, mall class column settings and so on.

2, in fact, open the DedeCms pseudo-static support and can not be fully configured in the background, there are many places or need to manually modify the rookie operation is not recommended.

3,5.3,5.5 and 5.6 channelunit.helper.php files need to manually search, and then modify, the path is different with 5.7.

Although they are generated statically, the end suffix name is. Html, included are the same, easy to Baidu included, but the difference is still quite big.

At the same time to talk about the dream weaving static and static generation difference:

(1) pseudo-static In fact, dynamic pages, but the end suffix into a. Html, looks more like static pages, search engines more like it.

(2) pseudo-static file changes, do not update all the pages, in particular, modify a file, not the entire station is generated, such as modifying the ad slot, do not have to take the time to update, the change can be seen immediately.

(3) pseudo-static in the latter part of a larger file, more cases, easy website maintenance.

(4) pseudo-static maintenance simple than pure static, but the frequency of occupying cpu, we all know that pure static pages than dynamic, pseudo static pages occupy less cpu.

Well, this article by Chaoshan News Network _ Puning News, Jiexi News, Jiedong News's chief platform http://chaoshannews.com/ a5 starter. So far, basically completed the dream home page, article pages, list pages pseudo-static settings.

Related Article

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.