一聚教程网:一个值得你收藏的教程网站

热门教程

phpcms如何设置伪静态

时间:2022-06-25 16:28:33 编辑:袖梨 来源:一聚教程网

那么phpcms如何设置伪静态

wordpress等其他程序设置伪静态一样。采用程序路由控制,或者htcaccess写重写规则。

phpcms可以采取htcaccess写重写规则,如:

 代码如下 复制代码

RewriteEngine on
RewriteRule ^content-([0-9]+)-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3
RewriteRule ^show-([0-9]+)-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3
RewriteRule ^list-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=lists&catid=$1&page=$2

只需上传htcaccess重写规则文件到www根目录就行了。

这样访问www.xxx.com/show-1-1-1.html就是rewite到了www.111com.net /index.php?
m=content&c=index&a=show&catid=1&id=1&page=1了,访问动态网址也可以访问。

热门栏目