Home CMS Tutorial DEDECMS How to set up pseudo-static in DEDECMS 5.7

How to set up pseudo-static in DEDECMS 5.7

Nov 09, 2019 pm 03:35 PM
dedecms Pseudo-static

How to set up pseudo-static in DEDECMS 5.7

DEDECMS 5.7伪静态怎么设置

织梦内容管理系统(DedeCms) 以简单、实用、开源而闻名,是国内最知名的PHP开源网站管理系统,也是使用用户最多的PHP类CMS系统,dedecms5.7功能更强大和实用,但是一些朋友对dede5.7的伪静态设置不是很熟悉,下面,就为大家分享一下dede5.7伪静态的设置方法。(推荐教程:dedecms教程)

第一步、后台-系统参数-核心设置-是否使用伪静态:选择“是”;

注:你的网站空间是否支持伪静态,你可以与空间的IDC商联系一下,如果是自己的服务器,那就更好办了,自己动手,丰衣足食。一般来说,空间都是支持伪静态的。Apache服务器伪静态相对简单,直接在.htaccess文件中加入相应伪静态规则即可;而IIS服务器伪静态的实现,则需要加载Rewrite组件,然后配置httpd.ini文件。 

第二步、如果你的网站已经存在生成的静态栏目或文章HTML,那么只需在后台-系统-SQL命令行工具中执行如下语句:

将所有文档设置为“仅动态浏览”:

1

update dede_archives set ismake=-1

Copy after login

将所有栏目设置为“使用动态页”:

1

update dede_arctype set isdefault=-1

Copy after login

第三步、列表页、文章页伪静态修改

打开/include/helpers/channelunit.helper.php。

(1)查找:

1

2

3

4

5

//动态文章

if($cfg_rewrite == 'Y')

{

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

}

Copy after login

替换为

1

2

3

4

5

//动态文章

if($cfg_rewrite == 'Y')

{

    return "/DedeCMS/DedeCMS5.7-".$aid.'-1.html';

}

Copy after login

意思是:将默认的/plus/view-1-1.html文章链接格式改为/DedeCMS/DedeCMS5.7-1-1.html。

(2) 查找:

1

2

//动态

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

Copy after login

替换为

1

2

//动态

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

Copy after login

意思是:将默认的频道或是列表页URL/plus//list.php?tid=1变更为/dedecms/list-1.html形式。

第四步、列表分页伪静态修改

打开/include/arc.listview.class.php

查找:

1

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

Copy after login

替换为

1

$plist = str_replace('plus/list.php?tid=', ‘DedeCMS/DedeCMS5.7-', $plist);

Copy after login

将默认的plus/list.php?tid=替换成RMB/list-;

意思是:将默认的列表分页链接格式plus/list.php?tid=x$x$xl修改为DedeCMS/DedeCMS5.7-x-x-x.html。

第五步、文章分页伪静态

打开/include/arc.archives.class.php,找到获取动态的分页列表GetPagebreakDM()函数末尾处:

查找:

1

$PageList = str_replace("plus/view.php?tid=","DedeCMS/DedeCMS5.7-",$PageList);

Copy after login

替换为

1

$plist = str_replace('plus/view.php?tid=', ’DedeCMS/DedeCMS5.7-', $plist);

Copy after login

将默认的plus/view.php?tid=替换成RMB/huilv-;

意思是:将默认的文章分页链接格式plus/view.php?tid=x$x$xl修改为DedeCMS/DedeCMS5.7-x-x-x.html

第六步、TAG标签伪静态

DedeCms默认的TAG标签URL,形如/tags.php?/dedecms模板 /,是不是觉得有个问号不怎么爽,我们改成/tags/dedecms模板 /,是不是好看多了。

下面我们来改一下,打开/include/taglib/tag.lib.php:

查找:

1

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

Copy after login

替换为

1

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

Copy after login

这样就修改好了,上传你到你的网站,切记:要记得将原网站备份哦!!

第七步、httpd.ini伪静态规则:

1

2

3

4

5

6

7

8

9

10

11

12

13

[ISAPI_Rewrite]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

RewriteRule ^(.*)/RMB/list-([0-9]+)\.html $1/plus/list\.php\?tid=$2 [I]

RewriteRule ^(.*)/RMB/list-([0-9]+)-([0-9]+)-([0-9]+)\.html $1/plus/list\.php\?tid=$2&TotalResult=$3&PageNo=$4 [I]

RewriteRule ^(.*)/RMB/huilv-([0-9]+)-([0-9]+)\.html $1/plus/view\.php\?arcID=$2&pageno=$3 [I]

RewriteRule ^(.*)/(.*)_(.*)_([0-9]+)\.html $1/huilv/?from=$2&to=$3&num=$4 [I]

RewriteRule ^(.*)/tags\.html $1/tags\.php [I]

RewriteRule ^(.*)/tags/(.*)(?:(\?.*))* $1/tags\.php\?\/$2 [I]

RewriteRule ^(.*)/tags/(.*)\/(?:(\?.*))* $1/tags\.php\?\/$2\/ [I]

RewriteRule ^(.*)/tags/(.*)\/([0-9])(?:(\?.*))* $1/tags\.php\?\/$2\/$3 [I]

RewriteRule ^(.*)/tags/(.*)\/([0-9])\/(?:(\?.*))* $1/tags\.php\?\/$2\/$3\/ [I]

Copy after login

将上面代码保存为:httpd.ini 上传到网站的根目录。

如无特特殊需求建议采用官方默认的生成静态的页面方式浏览。

The above is the detailed content of How to set up pseudo-static in DEDECMS 5.7. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Optimizing website SEO: practice of pseudo-static hiding php suffix Optimizing website SEO: practice of pseudo-static hiding php suffix Mar 07, 2024 pm 12:27 PM

As we all know, optimizing the SEO of a website is a very important part of website operation. The default URLs of dynamic web systems (such as PHP) used by many websites have extensions (.php, .html, etc.), which will affect the SEO effect of the website. In order to improve the optimization effect of the website, a common practice is to change the dynamic URL to a pseudo-static URL to hide the extension name and improve the user experience and search engine ranking of the website. This article will take "pseudo-static hidden php suffix" as the theme, introduce how to achieve this optimization in PHP websites, and

Where is the imperial cms resource network template? Where is the imperial cms resource network template? Apr 17, 2024 am 10:00 AM

Empire CMS template download location: Official template download: https://www.phome.net/template/ Third-party template website: https://www.dedecms.com/diy/https://www.0978.com.cn /https://www.jiaocheng.com/Installation method: Download template Unzip template Upload template Select template

How dedecms implements template replacement How dedecms implements template replacement Apr 16, 2024 pm 12:12 PM

Template replacement can be implemented in Dedecms through the following steps: modify the global.cfg file and set the required language pack. Modify the taglib.inc.php hook file and add support for language suffix template files. Create a new template file with a language suffix and modify the required content. Clear Dedecms cache.

How to upload local videos to dedecms How to upload local videos to dedecms Apr 16, 2024 pm 12:39 PM

How to upload local videos using Dedecms? Prepare the video file in a format that is supported by Dedecms. Log in to the Dedecms management backend and create a new video category. Upload video files on the video management page, fill in the relevant information and select the video category. To embed a video while editing an article, enter the file name of the uploaded video and adjust its dimensions.

What website can dedecms do? What website can dedecms do? Apr 16, 2024 pm 12:24 PM

Dedecms is an open source CMS that can be used to create various types of websites, including: news websites, blogs, e-commerce websites, forums and community websites, educational websites, portals, other types of websites (such as corporate websites, personal websites, photo album websites, video sharing website)

How to use dedecms How to use dedecms Apr 16, 2024 pm 12:15 PM

Dedecms is an open source Chinese CMS system that provides content management, template system and security protection. The specific usage includes the following steps: 1. Install Dedecms. 2. Configure the database. 3. Log in to the management interface. 4. Create content. 5. Set up the template. 6. Manage users. 7. Maintain the system.

Improve website security: Pseudo-static rules implement PHP suffix hiding Improve website security: Pseudo-static rules implement PHP suffix hiding Mar 07, 2024 am 11:33 AM

Improve website security: Pseudo-static rules implement PHP suffix hiding. With the development of the Internet, website security issues have become increasingly prominent, including the prevention of malicious attacks and the protection of user data. An effective measure is to hide the PHP suffix through pseudo-static rules, which helps improve the security of the website and protect user privacy. In achieving this goal, we need to use some specific code examples to demonstrate how to achieve PHP suffix hiding. First, we need to understand what pseudo-static rules are. Pseudo-static is a method of converting dynamic web page links into

What loopholes does dedecms have? What loopholes does dedecms have? Aug 03, 2023 pm 03:56 PM

DedeCMS is an open source content management system that has some potential vulnerabilities and security risks: 1. SQL injection vulnerability. Attackers can perform unauthorized operations or obtain sensitive data by constructing malicious SQL query statements; 2. File Upload vulnerability, attackers can upload files containing malicious code to the server to execute arbitrary code or obtain server permissions; 3. Sensitive information leakage; 4. Unauthenticated vulnerability exploitation.

See all articles