名站网址导航为大驾家提供DedeCMS站点程序站点教程相关的知识,比如织梦程序安装教程,织梦程序系统故障等教程。请确保你站点所在的主机或者服务器支持伪静态网站网页并且已经开启了伪静态网站网页功能!
本教程主要设置织梦程序伪静态网站网页页面包括有: 1.站点列表页 /plus/list-2.html 2.站点列表页分页 /plus/list-2-26-2.html 3.网站内容页 /plus/view-112-1.html 4.网站内容页分页 /plus/view-112-2.html 5.TAG标签页 /tags/织梦程序/ 6.TAG标签分页 /tags/织梦程序/2/ 7.搜索页 /search/织梦程序.html 8.搜索页分页 /search/织梦程序-2.html
站点网站的后台开启伪静态网站网页选项
站点网站的后台设置整站为动态
这里可以借助一个小插件来完成,一劳永逸
插件下载懒人包
站点网站文件修改
1、站点列表页和网站内容页伪静态网站网页链接 打开
\include\helpers\channelunit.helper.php 找到
- global $cfg_typedir_df;
- global $cfg_typedir_df, $cfg_rewrite;
- $reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;
- if($cfg_rewrite == 'Y')
- {
- $reurl = $GLOBALS["cfg_phpurl"]."/list-".$typeid.'.html';
- }
- else
- {
- //动态
- $reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;
- }
2、手机版站点列表页分页不使用电脑版伪静态网站网页
打开 \include\arc.listview.class.php 找到
- if($cfg_rewrite == 'Y')
- if($cfg_rewrite == 'Y' && !defined('DEDEMOB'))
3、TAG标签伪静态网站网页链接
打开 \include\taglib\tag.lib.php 找到
- $row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";
- $row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword'])."/";
4、TAG标签分页伪静态网站网页链接
打开 \include\arc.taglist.class.php 找到
- $this->PageNo = $GLOBALS['PageNo'];
- if($this->PageNo == 0)
- {
- $this->PageNo = 1;
- }
- $prepage="";
- global $cfg_rewrite;
- $purl .= "?/".urlencode($this->Tag);
- if($cfg_rewrite == 'Y')
- {
- $purl = "/tags/".urlencode($this->Tag);
- }
- else
- {
- $purl .= "?/".urlencode($this->Tag);
- }
4、搜索页伪静态网站网页链接
打开 \plus\search.php 找到
- $t1 = ExecTime();
- $keyword = preg_replace("/-(\d )/i",'',$keyword);
- $oldkeyword = preg_replace("/-(\d )/i",'',$oldkeyword);
- global $oldkeyword;
- global $oldkeyword, $cfg_rewrite;
- $purl .= "?".$geturl;
- if($cfg_rewrite != 'Y' && !defined('DEDEMOB'))
- {
- $purl .= "?".$geturl;
- }
- else
- {
- $purl = '/search/'.urlencode($oldkeyword);
- }
- return $plist;
- if($cfg_rewrite == 'Y' && !defined('DEDEMOB'))
- {
- $plist = preg_replace("/PageNo=(\d )/i",'-\\1.html',$plist);
- }
最后还需要在你模板里搜索框相关具体代码如下改成静态网站网页的js提交搜索,参考下面相关具体代码如下,注意红框的地方
- <script type="text/javascript">
- function search()
- {
- var q = document.getElementById("q").value;
- window.location.href = "http://www.2l3.net/search/" q ".html";
- }
- function enterIn(obj,evt)
- {
- var evt = evt ? evt : (window.event ? window.event : null);
- if (evt.keyCode == 13)
- {
- var q = obj.value;
- window.location.href = "http://www.2l3.net/search/" q ".html";
- }
- }
- </script>
- <form action="" method="post" onsubmit="return false">
- <div class="form">
- <h4>搜索</h4>
- <input name="q" id="q" onkeydown="enterIn(this,event);" type="text" />
- <button type="submit" class="search-submit" onclick="search()">搜索</button>
- </div>
- </form>
伪静态网站网页规则
懒人包已经打包了iis6、iis7、8、apache、nginx的规则网站文件
下面再写一下各规则
iis6伪静态网站网页规则 httpd.ini
- #站点列表页和站点列表分页
- RewriteRule ^(.*)/plus/list-([0-9] )\.html $1/plus/list\.php\?tid=$2
- RewriteRule ^(.*)/plus/list-([0-9] )-([0-9] )-([0-9] )\.html $1/plus/list\.php\?tid=$2&TotalResult=$3&PageNo=$4
- #网站内容页和网站内容分页
- RewriteRule ^(.*)/plus/view-([0-9] )-([0-9] )\.html $1/plus/view\.php\?arcID=$2&pageno=$3
- #TAG标签伪静态网站网页规则
- 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]
- #搜索页
- RewriteRule ^(.*)/search/(.*)-([0-9] )\.html $1/plus/search.php?q=$2&PageNo=$3&pagesize=2&searchtype=title
- RewriteRule ^(.*)/search/(.*)\.html $1/plus/search.php?q=$2&pagesize=2&searchtype=title
iis7、8伪静态网站网页规则 web.config
- <?xml version="1.0" encoding="UTF-8"?>
- <configuration>
- <system.webServer>
- <rewrite>
- <rules>
- <rule name="首页">
- <match url="^index.html$" ignoreCase="false" />
- <action type="Rewrite" url="index.php" appendQueryString="false" />
- </rule>
- <rule name="站点列表">
- <match url="^plus/list-([0-9] ).html$" ignoreCase="false" />
- <action type="Rewrite" url="/plus/list.php?tid={R:1}" appendQueryString="false" />
- </rule>
- <rule name="站点列表分页">
- <match url="^plus/list-([0-9] )-([0-9] )-([0-9] ).html$" ignoreCase="false" />
- <action type="Rewrite" url="/plus/list.php?tid={R:1}&totalresult={R:2}&PageNo={R:3}" appendQueryString="false" />
- </rule>
- <rule name="文章分页">
- <match url="^plus/view-([0-9] )-([0-9] ).html$" ignoreCase="false" />
- <action type="Rewrite" url="/plus/view.php?aid={R:1}&pageno={R:2}" appendQueryString="false" />
- </rule>
- <rule name="tag首页">
- <match url="^tags.html$" ignoreCase="false" />
- <action type="Rewrite" url="tags.php" appendQueryString="false" />
- </rule>
- <rule name="tag站点列表">
- <match url="^tags/(.*)(?:(\?.*))*$" ignoreCase="false" />
- <action type="Rewrite" url="/tags.php?/{R:1}" appendQueryString="false" />
- </rule>
- <rule name="tag站点列表最后有左斜杠">
- <match url="^tags/(.*)/(?:(\?.*))*$" ignoreCase="false" />
- <action type="Rewrite" url="/tags.php?/{R:1}/" appendQueryString="false" />
- </rule>
- <rule name="tag站点列表分页">
- <match url="^tags/(.*)/([0-9])(?:(\?.*))*$" ignoreCase="false" />
- <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" />
- </rule>
- <rule name="tag站点列表分页最后有左斜杠">
- <match url="^tags/(.*)/([0-9])/(?:(\?.*))*$" ignoreCase="false" />
- <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}/" appendQueryString="false" />
- </rule>
- <rule name="搜索页分页">
- <match url="^search/(.*)-([0-9] ).html$" ignoreCase="false" />
- <action type="Rewrite" url="/plus/search.php?q={R:1}&PageNo={R:2}&pagesize=2&searchtype=title" appendQueryString="false" />
- </rule>
- <rule name="搜索页">
- <match url="^search/(.*).html$" ignoreCase="false" />
- <action type="Rewrite" url="/plus/search.php?q={R:1}&pagesize=2&searchtype=title" appendQueryString="false" />
- </rule>
- </rules>
- </rewrite>
- </system.webServer>
- </configuration>
apache伪静态网站网页规则 .htaccess
- #站点列表页和站点列表分页
- 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] )-([0-9] )\.html$ plus/view.php?arcID=$1&pageno=$2
- #TAG标签
- RewriteRule ^tags\.html$ tags\.php
- RewriteRule ^tags/(.*)(?:(\?.*))* tags\.php\?\/$1
- RewriteRule ^tags/(.*)\/(?:(\?.*))* tags\.php\?\/$1\/
- RewriteRule ^tags/(.*)\/([0-9])(?:(\?.*))* tags\.php\?\/$1\/$2
- RewriteRule ^tags/(.*)\/([0-9])\/(?:(\?.*))* tags\.php\?\/$1\/$2\/
- #搜索页
- RewriteRule ^search/(.*)-([0-9] )\.html$ plus/search.php?q=$1&PageNo=$2&pagesize=2&searchtype=title
- RewriteRule ^search/(.*)\.html$ plus/search.php?q=$1&pagesize=2&searchtype=title
nginx伪静态网站网页规则
- rewrite ^/plus/list-([0-9] )\.html$ /plus/list.php?tid=$1;
- rewrite ^/plus/list-([0-9] )-([0-9] )-([0-9] )\.html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3;
- rewrite ^/plus/view-([0-9] )-1\.html$ /plus/view.php?arcID=$1;
- rewrite ^/plus/view-([0-9] )-([0-9] )\.html$ /plus/view.php?aid=$1&pageno=$2;
- rewrite ^/tags\.html$ /tags.php;
- rewrite ^/tags/(.*)(?:(\?.*))* /tags.php?/$1;
- rewrite ^/tags/(.*)/(?:(\?.*))* /tags.php?/$1/;
- rewrite ^/tags/(.*)/([0-9])(?:(\?.*))* /tags.php?/$1/$2;
- rewrite ^/tags/(.*)/([0-9])/(?:(\?.*))* /tags.php?/$1/$2/;
- rewrite ^/search/(.*)-([0-9] )\.html$ /plus/search.php?q=$1&PageNo=$2&pagesize=2&searchtype=title;
- rewrite ^/search/(.*)\.html$ /plus/search.php?q=$1&pagesize=2&searchtype=title;
关于DedeCMS站点程序站点教程相关的知识,就说到这里了希望能帮助朋友们。Dedecms 数据库结构分析