之前在apache上设置过akcms的伪静态,今天换了nginx后,设置方法如下:
分类栏目的链接(ak后台设置里显示的是栏目首页URL设置为:[categorypath]/),前台显示的是https://** * . com/news/ 这种形式。
内容页第1套URL,设置成[id].html,相应的伪静态规则如下:
rewrite ^/([a-zA-Z0-9\-_]+)/$ /akcms_category.php?path=$1 last; rewrite ^/([0-9]+)\.html$ /akcms_item.php?id=$1 last; rewrite ^/([a-zA-Z0-9\-_]+)/index\.html$ /akcms_category.php?path=$1 last; rewrite ^/([a-zA-Z0-9\-_]+)-([0-9]+)\.html$ /akcms_category.php?path=$1&page=$2 last; rewrite ^/([a-zA-Z0-9\-_\/]+\.html)$ /akcms_rounter.php?filename=$1 last;
分页的模板代码如下:
<{getpaging page=$page template="<a href="[url]" data-page="[page]">[page]</a>" baseurl="/$path-[page].html" firstpage="/$path/" firsttemplate="<a href='[url]'>«</a> " currenttemplate="<span class='layui-laypage-curr'><em class='layui-laypage-em' style='background-color:#1E9FFF;'></em><em>[page]</em></span>" alreadyfirsttemplate="<a href='javascript:;' class='layui-laypage-prev layui-disabled' data-page='0'>«</a>" lasttemplate="<a href='[url]' class='layui-laypage-last' data-page='[page]'>»</a>" alreadylasttemplate="<a href='javascript:;' class='layui-laypage-prev layui-disabled' data-page='0'>»</a>" previoustemplate="<a href='/$path/[url]' class='layui-laypage-prev' data-page=''><</a>" noprevioustemplate=" <span><</span> " nexttemplate="<a href='/$path/[url]' class='layui-laypage-prev' data-page=''>></a>" nonexttemplate=" <span>></span>" paging="[first][paging][last]" }>
分类第二页显示的链接是:/new-2.html
有话要说...