DedeCMS V5.7 enable pseudo-static rewrite settings list, article tutorial

Source: Internet
Author: User

Although DEDE can generate static pages, it can also be rewritten to be pseudo-static. You can enable the pseudo-static page with settings in the background. After the feature is enabled, it must be set before it can be used.

1. First, it is best to set topics and articles to dynamic browsing so that static html files are not generated.

2. Set rewrite rules and add a. htaccess file under the system directory. The content is as follows:

RewriteEngine On
RewriteRule ^ plus/list-([0-9] +) \. html $/plus/list. php? Tid = $1
RewriteRule ^ plus/list-([0-9] +)-([0-9] +)-([0-9] + )\. html $/plus/list. php? Tid = $1 & totalresult = $2 & PageNo = $3
RewriteRule ^ plus/view-([0-9] +)-1 \. html $/plus/view. php? ArcID = $1
RewriteRule ^ plus/view-([0-9] +)-([0-9] +) \. html $/plus/view. php? Aid = $1 & pageno = $2

If your system supports url rewriting, you can use pseudo-static access here.

3. Modify the rewritten URL
If you use the default settings, the access URL is:

Http://www.XXXX.com/plus/view-131-1.html

We can change this style in this form.

Find the/include/helpers/channelunit. helper. php file to open it.

We can see such a statement.
Return $ GLOBALS ["pai_plus_dir"]. "/view-" .20.aid.'-1.html ';

This is the url form of the article.

$ Reurl = $ GLOBALS ['cfg _ phpurl']. "/list. php? Tid = ". $ typeid;

This is the list rewrite url.

The url can be written as follows:

Return "/view-" .w.aid.'-1.html ';

And

$ Reurl = "/list-". $ typeid. ". html ";

At this time, the rewrite rule should also be updated.

RewriteEngine On
RewriteRule ^ list-([0-9] +) \. html $/plus/list. php? Tid = $1
RewriteRule ^ list-([0-9] +)-([0-9] +)-([0-9] + )\. html $/plus/list. php? Tid = $1 & totalresult = $2 & PageNo = $3
RewriteRule ^ view-([0-9] +)-1 \. html $/plus/view. php? ArcID = $1
RewriteRule ^ view-([0-9] +)-([0-9] +) \. html $/plus/view. php? Aid = $1 & pageno = $2

Furthermore, you can replace the view with any of your own words, which also replaces the view in the include/arc. archives. class. Php file.

Publish option: generate HTML. You can select this option only when you dynamically browse and publish an article. In order to upgrade later, minimize the number of file modifications.

This is not a test. You can test it as needed ~~

Modify database

Set all documents to "dynamic only". You can go to database management and execute the following command:

Update dede_archives set ismake =-1

Set the default value of ismake to-1, which is dynamic.

Set all columns to "use dynamic pages" to go to database management and execute the following command:

Update dede_arctype set isdefault =-1

---------------------------- I am a split line ------------------------------------

Pseudo-static rules under WIN:

HTTP. INI

[ISAPI_Rewrite]

# Cache 3600 seconds = 1 hour (hour)
CacheClockRate 3600

RepeatLimit 32
RewriteRule ^ (. *)/index \. html $1/index \. html
RewriteRule ^ (. *)/list-([0-9] +) \. html $1/plus/list \. php \? Tid = $2
RewriteRule ^ (. *)/list-([0-9] +)-([0-9] +)-([0-9] + )\. html $1/plus/list \. php \? Tid = $2 & TotalResult = $3 & PageNo = $4
RewriteRule ^ (. *)/view-([0-9] +)-([0-9] +) \. html $1/plus/view \. php \? ArcID = $2 & pageno = $3

---------------------------- I am a split line ------------------------------------

The/plus/

Example: www.111cn.net/plus/list-2-16-2.html

Open include/arc. listview. class. php and find

$ Plist = str_replace ('. php? Tid = ','-', $ plist );

(About 964th rows)

Add a line above it

$ Plist = str_replace ('plus/list', 'list', $ plist );

This is the url format of the list page rewrite.

You can do whatever you like in the plus and list fields.

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.