Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure pseudo-static in the whole station of dream-weaving system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to configure the pseudo-static of the dream weaving system. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Dream weaving system station-wide pseudo-static how to configure?

Detailed explanation of the pseudo-static configuration process of the whole station of dream weaving system

The premise is to ensure that your space or server supports pseudo-static, that is, URL rewriting; the method to enable pseudo-static: background-- "system--" core settings to find: whether to use pseudo-static: select to be sure to save. See this article for specific configuration.

Prerequisites for enabling pseudo-static

Make sure your space or server supports pseudo-static, or URL rewriting.

Enable DedeCms pseudo-static

The way to turn on pseudo-static: background-- "system--" core setting to find: whether to use pseudo-static: select to make sure to save.

Column and article publishing settings

Column list options: select publish using dynamic pages option: select dynamic browsing only

DEDECMS pseudo-static method of the whole station

Pseudo-static home page

Delete the index.html under the root directory of the site, and do not update the home page HTML in the future, of course, you can also choose not to use the dynamic home page.

Pseudo-static of channels, lists and articles

This is mainly achieved by modifying the two functions GetFileName () and GetTypeUrl (). DedeCms v5.3, DedeCms V5.5 and DedeCms V5.6, open / include/channelunit.func.php to modify.

Note: DedeCms V5.7, this file path has been changed, you can open / include/helpers/channelunit.helper.php.

a. Put the following code in GetFileName (): / / dynamic article

The code is as follows:

If ($cfg_rewrite = ='Y') {return $GLOBALS ["cfg_plus_dir"]. "/ view-". $aid.'-1.html';}

Replace with / / dynamic articles

The code is as follows:

If ($cfg_rewrite = ='Y') {return "/ archives/view-". $aid.'-1.html';}

Set the default / plus/view-1-1.html of the article page

Link format changed to / archives/view-1-1.html

This is as much as you like, and you don't have to change it.

b. Change the following code in GetTypeUrl (): / / dynamic

The code is as follows:

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

Replace with / / dynamic

The code is as follows:

$reurl = "/ category/list-". $typeid. ".html"

This step must be modified to change your channel or list page URL to / category/list-1.html.

List paging pseudo-static

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

The code is as follows:

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

Replace with

The code is as follows:

$plist = str_replace ('plus',' category', $plist)

Replace the default plus with

The code is as follows:

Category$plist = str_replace ('.php? tid=',' -', $plist)

Paginate the list in the default link format / plus/list-1-2-1.html

Modify to / category/list-1-2-1.html

This step may not be changed.

DEDECMS article paging pseudo-static

Open / include/arc.archives.class.php and find the end of the GetPagebreakDM () function that gets the dynamic paging list:

The code is as follows:

$PageList = str_replace (".php? aid=", "-", $PageList)

Replace with

The code is as follows:

$plist = str_replace ('plus',' archives', $plist)

Replace the default plus with

The code is as follows:

Archives$PageList = str_replace (".php? aid=", "-", $PageList)

This step is fine without modification. It's just a matter of personal preference.

TAG tag pseudo-static

DedeCms's default TAG tag URL, shaped like / tags.php?/dedecms5.7/, is very ugly. Open / include/taglib/tag.lib.php and find the following under the lib_tag () function:

The code is as follows:

$row ['link'] = $cfg_cmsurl. "/ tags.php?/" .urlencode ($row [' keyword']). "/"

Replace with

The code is as follows:

$row ['link'] = $cfg_cmsurl. "/ tags/" .urlencode ($row [' keyword']). "/"

At this point, the ".php?" in the TAG tag URL The number was removed.

Search pseudo-static

DedeCms search URL static is more troublesome, not to mention the accompanying parameters, parameters may also change, such as search results paging URL is particularly troublesome, pseudo-static rule matching is complex. Xiaopan will be lazy and will search for "search.php?" in URL. Directly replace it with "search.html?" As for "?" The parameters after the number are matched with any character.

Open channelunit.func.php, arc.searchview.class.php, arc.taglist.class.php and / include/taglib/hotwords.lib.php under the include folder, and look for "search.php?" Replace with "search.html?" That's it.

Tips, I feel that dedecms itself does not intend to allow users to set pseudo-static function, so it feels that most people want to modify it is still very complicated.

On the dream weaving system site-wide pseudo-static configuration is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report