个人修改记录,不一定适合大众. 列表命名规则: 复制代码代码如下: /list/list-{tid}-{page}.html 文章命名规则: 复制代码代码如下: /test/{Y}{M}/{aid}.html .htac
个人修改记录,不一定适合大众.
列表命名规则:
复制代码代码如下:
/list/list-{tid}-{page}.html
文章命名规则:
复制代码代码如下:
/test/{Y}{M}/{aid}.html
.htaccess
复制代码代码如下:
RewriteRule ^([a-zA-Z]+)/([0-9]+)/([0-9]+)\.html$ /plus/view.PHP?arcID=$3
RewriteRule ^([a-zA-Z]+)/([0-9]+)/([0-9]+)-([0-9]+)\.html$ /plus/view.php?aid=$3&pageno=$4
include/arc.arcHives.class.php
复制代码代码如下:
//获得动态页面分页列表
function GetPagebreakDM($totalPage,$nowPage,$aid)
{
global $cfg_rewrite;
if($totalPage==1)
{
return “”;
}
$PageList = “<li><a>共”.$totalPage.”页: </a></li>”;
$nPage = $nowPage-1;
$lPage = $nowPage+1;
if($nowPage==1)
{
$PageList.=”<li><a href=’#'>上一页</a></li>”;
}
else
{
if($nPage==1)
{
$PageList.=”<li><a href=’view.php?aid=$aid’>上一页</a></li>”;
if($cfg_rewrite == ‘Y’)
{
$PageList = preg_replace(“/view.php\?aid=(\d+)/i”,’-\\1-1.html’,$PageList);
}
}
else
{
$PageList.=”<li><a href=’view.php?aid=$aid&pageno=$nPage’>上一页</a></li>”;
if($cfg_rewrite == ‘Y’)
{
$PageList = str_replace(“view.php?aid=”,“”,$PageList);
$PageList = preg_replace(“/&pageno=(\d+)/i”,’-\\1.html’,$PageList);
}
}
}
for($i=1;$i<=$totalPage;$i++)
{
if($i==1)
{
if($nowPage!=1)
{
$PageList.=”<li><a href=’view.php?aid=$aid’>1</a></li>”;
if($cfg_rewrite == ‘Y’)
{
$PageList = preg_replace(“/view.php\?aid=(\d+)/i”,’-\\1-1.html’,$PageList);
}
}
else
{
$PageList.=”<li class=\”thisclass\”><a>1</a></li>”;
}
}
else
{
$n = $i;
if($nowPage!=$i)
{
$PageList.=”<li><a href=’view.php?aid=$aid&pageno=$i’>”.$n.”</a></li>”;
if($cfg_rewrite == ‘Y’)
{
$PageList = str_replace(“view.php?aid=”,“”,$PageList);
$PageList = preg_replace(“/&pageno=(\d+)/i”,’-\\1.html’,$PageList);
}
}
else
{
$PageList.=”<li class=\”thisclass\”><a href=’#'>{$n}</a></li>”;
}
}
}
if($lPage <= $totalPage)
{
$PageList.=”<li><a href=’view.php?aid=$aid&pageno=$lPage’>下一页</a></li>”;
if($cfg_rewrite == ‘Y’)
{
$PageList = str_replace(“view.php?aid=”,“”,$PageList);
$PageList = preg_replace(“/&pageno=(\d+)/i”,’-\\1.html’,$PageList);
}
}
else
{
$PageList.= “<li><a href=’#'>下一页</a></li>”;
}
return $PageList;
}
//获得静态页面分页列表
function GetPagebreak($totalPage,$nowPage,$aid)
{
if($totalPage==1)
{
return “”;
}
$PageList = “<li><a>共”.$totalPage.”页: </a></li>”;
$nPage = $nowPage-1;
$lPage = $nowPage+1;
if($nowPage==1)
{
$PageList.=”<li><a href=’#'>上一页</a></li>”;
}
else
{
if($nPage==1)
{
$PageList.=”<li><a href=’”.$this->NameFirst.”.”.$this->ShortName.”‘>上一页</a></li>”;
}
else
{
$PageList.=”<li><a href=’”.$this->NameFirst.“-”.$nPage.”.”.$this->ShortName.”‘>上一页</a></li>”;
}
}
for($i=1;$i<=$totalPage;$i++)
{
if($i==1)
{
if($nowPage!=1)
{
$PageList.=”<li><a href=’”.$this->NameFirst.”.”.$this->ShortName.”‘>1</a></li>”;
}
else
{
$PageList.=”<li class=\”thisclass\”><a href=’#'>1</a></li>”;
}
}
else
{
$n = $i;
if($nowPage!=$i)
{
$PageList.=”<li><a href=’”.$this->NameFirst.“-”.$i.”.”.$this->ShortName.”‘>”.$n.”</a></li>”;
}
else
{
$PageList.=”<li class=\”thisclass\”><a href=’#'>{$n}</a></li>”;
}
}
}
if($lPage <= $totalPage)
{
$PageList.=”<li><a href=’”.$this->NameFirst.“-”.$lPage.”.”.$this->ShortName.”‘>下一页</a></li>”;
}
else
{
$PageList.= “<li><a href=’#'>下一页</a></li>”;
}
return $PageList;
}
include/arc.listview.class.php
复制代码代码如下:
$plist = str_replace(‘&TotalResult=’, ‘-’, $plist);
去除动态列表网址里带有列表的文章总数
复制代码代码如下:
$plist = preg_replace(“/&TotalResult=(\d+)/i”, ”, $plist);
--结束END--
本文标题: dedecms 5.5 伪静态化ReWrite规则
本文链接: https://lsjlt.com/news/31080.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-27
2023-10-27
2023-10-26
2023-10-25
2023-10-21
2023-10-21
2023-10-18
2023-10-12
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0