您现在的位置是:首页>建站教程>建站知识

PHPCMS伪静态设置-平顶山网站建设提供技术支持

王青召个人博客 2023-08-23 建站知识 4893人已围观

简介一:phpcms后台配置:1:扩展---》URL规则管理---》添加规则 注意在填“URL规则名称”时,列表为:category,详情页为:show2:内容---》管理栏目---》修改---》生成HTML设置---》“栏目页URL规则”选择刚才自己制定的规则---》提交并清除缓存二:服务器端配置伪静态规则1:查看服务器是否支

  一:phpcms后台配置:


  1:扩展---》URL规则管理---》添加规则

  注意在填“URL规则名称”时,列表为:category,详情页为:show

  2:内容---》管理栏目---》修改---》生成HTML设置---》“栏目页URL规则”选择刚才自己制定的规则---》提交并清除缓存


  二:服务器端配置伪静态规则


  1:查看服务器是否支持rewrite。(常见服务器Apache、Iis、Nginx)

  不同的Web服务器的开启rewrite方法不同,见:http://hi.baidu.com/wangyuman/item/935fae003bac19f575cd3c6f

  2:针对不同的服务器配置伪静态规则(不同的服务器配置规则不同)

  注意:Apache服务器将规则写在.htaccess文件中。将phpcms v9 readme目录下的.htaccess文件放到网站的根目录下。

  Nginx服务器将规则写在xxxxx.conf文件中。

  PHPCMS V9 伪静态规则 for Apache:

  RewriteEngine on

  RewriteBase /

  //如果安装在子目录需要制定RewriteBase

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

  RewriteRule ^announce_([0-9]+).html index.php?m=announce&c=index&a=show&aid=$1

  RewriteRule ^rss.html index.php?m=content&c=rss&siteid=$1

  RewriteRule ^tag_([0-9,a-z]*)_(.*).html index.php?m=content&c=tag&catid=$1&tag=$2

  PHPCMS V9在Rewrite伪静态Nginx规则:

  location / {

  if (!-f $request_filename){

  rewrite (.*) /index.php;

  }

  rewrite ^/caipu-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last;

  rewrite ^/content-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last;

  rewrite ^/list-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=lists&catid=$1&page=$2 last;

  }


  PHPCMS V9伪静态规则 win下IIS完美设置:


  新建一个记事本文件,将文件名改为:httpd.ini。再将以下代码粘贴进去:

  [ISAPI_Rewrite]

  # 3600 = 1 hour

  CacheClockRate 3600

  RepeatLimit 32

  RewriteEngine on

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

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

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

  PHPCMS V9分类信息列表页在IIS6 伪静态规则:

  RewriteRule /list-(d+)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).html /index.php?m=content&c=index&a=lists&catid=$1&city=$2&agent=$3&bedroom=$4&objecttype=$5&pay_type_int=$6&price=$7&rent_mode=$8&zone=$9&page=$10


站点信息

  • 建站时间:2022年11月15日
  • 文章统计175 篇文章
  • 网站地图网站地图
  • 站长微信:扫描二维码,关注我

打赏本站

  • 如果你觉得本站很棒,可以通过扫码支付打赏哦!
  • 微信扫码:你说多少就多少~
  • 支付宝扫码:你说多少就多少~

客服在线

服务时间

周一至周日 9:00-21:00