shopnc b2b2c伪静态开启与写法

shopnc b2b2c伪静态功能很简单,但是官方伪静态中设置的只有伪静态商城和cms中的文章信息,但里面一些栏目跟圈子那边都没有使用到伪伪静态的写法.

在shopnc中开启伪静态很简单,在/data/config/config.ini.php

在里面开启

$config[‘url_model’] = true; //伪静态开启

这样子就开启了,但cms和圈子中要使用伪静态功能还要改不少代码,下面我就分享一个cms中在apache中伪静态的规则给大家:

<IfModule mod_rewrite.c>
RewriteEngine on

#文章
RewriteRule ^article.html$ index.php?act=article&op=article_list
RewriteRule ^article_list_([0-9]+).html$ index.php?act=article&op=article_list&class_id=$1
RewriteRule ^article_tag_([0-9]+).html$ index.php?act=article&op=article_tag_search&tag_id=$1
RewriteRule ^article_key_((.*?)+).html$ index.php?act=article&op=article_search&keyword=$1
#画报
RewriteRule ^picture.html$ index.php?act=picture&op=picture_list
RewriteRule ^picture_list_([0-9]+).html$ index.php?act=picture&op=picture_list&class_id=$1
RewriteRule ^picture_tag_([0-9]+).html$ index.php?act=picture&op=picture_tag_search&tag_id=$1
RewriteRule ^picture_key_((.*?)+).html$ index.php?act=picture&op=picture_search&keyword=$1
#专题
RewriteRule ^special.html$ index.php?act=special&op=special_list
RewriteRule ^special-([0-9]+).html$ index.php?act=special&op=special_detail&special_id=$1

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

#过滤服务器启用了TRACE Method
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* – [F]
# mod_fcgid & php-cgi
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
# php5apache2_2.dll
#RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

</IfModule>

以上是规则,但写规则了,还要在代码中写入对应的实现方法!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值