shopnc b2b2c偽靜態(tài)功能很簡(jiǎn)單,但是官方偽靜態(tài)中設(shè)置的只有偽靜態(tài)商城和cms中的文章信息,但里面一些欄目跟圈子那邊都沒(méi)有使用到偽偽靜態(tài)的寫(xiě)法.
在shopnc中開(kāi)啟偽靜態(tài)很簡(jiǎn)單,在/data/config/config.ini.php
在里面開(kāi)啟
$config['url_model'] = true; //偽靜態(tài)開(kāi)啟
這樣子就開(kāi)啟了,但cms和圈子中要使用偽靜態(tài)功能還要改不少代碼,下面我就分享一個(gè)cms中在apache中偽靜態(tài)的規(guī)則給大家:
<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
#畫(huà)報(bào)
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
#專(zhuān)題
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
#過(guò)濾服務(wù)器啟用了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>
以上是規(guī)則,但寫(xiě)規(guī)則了,還要在代理中寫(xiě)入對(duì)應(yīng)的實(shí)現(xiàn)方法,下次有空再把代碼發(fā)上來(lái)!
新聞熱點(diǎn)
疑難解答
圖片精選