分享好友 DESTOON技术首页 DESTOON技术分类 切换频道

Destoon B2B URL Rewrite(伪静态)设置方法

2013-11-2924560Destoon爱好者
1、如果您的服务器支持.htaccess,则无需设置,网站根目录下的.htaccess已经设置好规则。
规则详情:
# Destoon B2B Rewrite Rules
ErrorDocument 404 /404.php
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.php
RewriteRule ^(.*)/file/(.*)\.php(.*)$ /404.php
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ $1/show.php?itemid=$2&page=$4
RewriteRule ^(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ $1/list.php?catid=$2&page=$4
RewriteRule ^(.*)/show/([0-9]+)/([0-9]+)?([/])?$ $1/show.php?itemid=$2&page=$3
RewriteRule ^(.*)/list/([0-9]+)/([0-9]+)?([/])?$ $1/list.php?catid=$2&page=$3
RewriteRule ^(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$3&page=$4
RewriteRule ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index.php?rewrite=$3
RewriteRule ^(com)/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$ index.php?homepage=$2&file=$3&rewrite=$4
RewriteRule ^(com)/([a-z0-9_\-]+)/([a-z]+)([/])?$ index.php?homepage=$2&file=$3
RewriteRule ^(com)/([a-z0-9_\-]+)([/])?$ index.php?homepage=$2

2、如果是Apache服务器

Apache 1.x 的用户请检查 conf/httpd.conf 中是否存在如下两段代码: 
LoadModule rewrite_module     libexec/mod_rewrite.so
AddModule mod_rewrite.c

Apache 2.x 的用户请检查 conf/httpd.conf 中是否存在如下一段代码: 
LoadModule rewrite_module     modules/mod_rewrite.so

如果存在,且以#开头,请删除#。然后在配置文件(通常就是 conf/httpd.conf或者conf/extra/httpd-vhosts.conf)中加入如下代码。此时请务必注意,如果网站使用通过虚拟主机来定义,请务必加到虚拟主机配置,即 中去,如果加在虚拟主机配置外部将可能无法使用。改好后然后将 Apache 重启。

Apache conf文件配置规则:

# Destoon B2B Rewrite Rules
ErrorDocument 404 /404.php
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.php
RewriteRule ^(.*)/file/(.*)\.php(.*)$ /404.php
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ $1/show.php?itemid=$2&page=$4
RewriteRule ^(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ $1/list.php?catid=$2&page=$4
RewriteRule ^(.*)/show/([0-9]+)/([0-9]+)?([/])?$ $1/show.php?itemid=$2&page=$3
RewriteRule ^(.*)/list/([0-9]+)/([0-9]+)?([/])?$ $1/list.php?catid=$2&page=$3
RewriteRule ^(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$3&page=$4
RewriteRule ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index.php?rewrite=$3
RewriteRule ^(.*)/com/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$ $1/index.php?homepage=$2&file=$3&rewrite=$4
RewriteRule ^(.*)/com/([a-z0-9_\-]+)/([a-z]+)([/])?$ $1/index.php?homepage=$2&file=$3
RewriteRule ^(.*)/com/([a-z0-9_\-]+)([/])?$ $1/index.php?homepage=$2

 

3、Nginx规则

rewrite ^/(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.php last;
rewrite ^/(.*)/file/(.*)\.php(.*)$ /404.php last;
rewrite ^/(.*)-htm-(.*)$ /$1.php?$2 last;
rewrite ^/(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ /$1/show.php?itemid=$2&page=$4 last;
rewrite ^/(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ /$1/list.php?catid=$2&page=$4 last;
rewrite ^/(.*)/show/([0-9]+)/([0-9]+)?([/])?$ /$1/show.php?itemid=$2&page=$3 last;
rewrite ^/(.*)/list/([0-9]+)/([0-9]+)?([/])?$ /$1/list.php?catid=$2&page=$3 last;
rewrite ^/(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$ /$1/list.php?catid=$3&page=$4 last;
rewrite ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index.php?rewrite=$3 last;
rewrite ^/(com)/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$ /index.php?homepage=$2&file=$3&rewrite=$4 last;
rewrite ^/(com)/([a-z0-9_\-]+)/([a-z]+)([/])?$ /index.php?homepage=$2&file=$3 last;
rewrite ^/(com)/([a-z0-9_\-]+)([/])?$ /index.php?homepage=$2 last;

 

4、Zeus规则

match URL into $ with ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ 
if matched then 
 set URL = /404.php
endif
match URL into $ with ^(.*)/file/(.*)\.php(.*)$ 
if matched then 
 set URL = /404.php
endif
match URL into $ with ^(.*)-htm-(.*)$ 
if matched then 
 set URL = $1.php?$2 
endif
match URL into $ with ^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ 
if matched then 
 set URL = $1/show.php?itemid=$2&page=$4 
endif
match URL into $ with ^(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ 
if matched then 
 set URL = $1/list.php?catid=$2&page=$4 
endif
match URL into $ with ^(.*)/show/([0-9]+)/([0-9]+)?([/])?$ 
if matched then 
 set URL = $1/show.php?itemid=$2&page=$3 
endif
match URL into $ with ^(.*)/list/([0-9]+)/([0-9]+)?([/])?$ 
if matched then 
 set URL = $1/list.php?catid=$2&page=$3 
endif
match URL into $ with ^(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$
if matched then 
 set URL = $1/list.php?catid=$3&page=$4
endif
match URL into $ with ^(.*)/([a-z]+)/(.*)\.shtml$ 
if matched then 
 set URL = $1/$2/index.php?rewrite=$3 
endif
match URL into $ with ^(.*)/com/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$ 
if matched then 
 set URL = $1/index.php?homepage=$2&file=$3&rewrite=$4 
endif
match URL into $ with ^(.*)/com/([a-z0-9_\-]+)/([a-z]+)([/])?$ 
if matched then 
 set URL = $1/index.php?homepage=$2&file=$3 
endif
match URL into $ with ^(.*)/com/([a-z0-9_\-]+)([/])?$ 
if matched then 
 set URL = $1/index.php?homepage=$2 
endif

5、IIS6服务器

 

请下载 http://download.destoon.com/rewrite/IIS_Rewrite.zip
规则已经设置好,按readme.txt文件内容进行操作
如果网站支持httpd.ini文件,请下载
http://download.destoon.com/rewrite/httpd.ini

7、IIS7服务器

请参考 http://download.destoon.com/rewrite/web.config.txt


Rewrite生效后,请在网站后台 网站设置 SEO优化 URL Rewrite  选择开启 提交

然后进入各模块的模块设置 SEO设置 选择对应伪静态地址规则

选择更新地址 提交

举报
收藏 0
打赏 0
评论 0
destoon去掉图集默认无图图标
怎样去除图集中默认的无图图片呢,非常简单,打开include/module.func.php,第244行while($i++5) {改成while($i++0) {即可。

0评论2021-06-21347

destoon调用会员商铺二级分类
下面以destoon7.0商铺产品分类做示例:!--{php$tags=tag(table=typecondition=item='product-.$userid.'pagesize=8order=listorderasc,typeiddesctemplate=null);}--{loop$tags$i$t}{if$i7}liahref={userurl

0评论2020-09-30390

destoon商铺调用标题文字长度
destoon商铺在调用产品标题的时候很多时候会调用到标题,但是标题有长有短,为了布局好看,通常都要统一标题进行设置!用CSS有时候不好控制,所以我们只好在调用标题的时候,直接固定写死,想调用几个字就几个字,调

0评论2020-07-31265

destoon系统升级指南
Destoon B2B网站管理系统是一套完善的B2B(电子商务)行业门户解决方案。系统基于PHP+MySQL开发,采用B/S架构,模板与程序分离,源码开放。模型化的开发思路,可扩展或删除任何功能;创新的缓存技术与数据库设计,可

0评论2020-06-28378

destoon如何在首页调用会员商铺图片和内容
我们很多时候在用destoon编辑网站时,很多情况下都需要调用会员商铺的内容到首页,这样才能客观的宣传网站的情况!而这时候我们就需要调用,话不多说,下边就是小编亲测的效果会员名称调用如下:!--{php $tags=tag(mo

0评论2020-06-28395

destoo模板目录和商铺页面相对应的中文
话不多说,直接上图,本文以destoon高端模板为例 模块名称目录名称备注整理员资讯模块article品牌模块brand求购模块buy片段目录chip用于放扩展文件城市分站city城市分站首页模板商圈模块club公司模块company下载模块

0评论2020-06-09218

destoon调用广告位位下的所有广告代码
destoon模板如何调用独立的广告ID下的所有图片,在网站上无论哪个位置都可以调用!代码如下!--{php$xiaohei=tag(table=adcondition=status=3andpid=25andtotime$DT_TIMEareaid=$cityidpagesize=6order=listorder

0评论2020-06-08409

destoon标签字符串的定义
随着b2b的高速发展,很多购物网站改用更为专业的destoon模板系统,随之而来的也是越来越多的客户群体,但是对于初学者来说,destoon的标签字符串调用规则很多同学难以理解,今天小编特意整理了一下,标签字符串的定

0评论2020-06-08225

destoon商铺中为友情链接增加nofollow标签
在模板管理-公司主页-友情链接修改默认路径为template/default/homepage/link.htm,修改td width=33%a href={$v[linkurl]} target=_blank{$v[title]}/a/td为td width=33%a href={$v[linkurl]} rel=nofollowtarget=_b

0评论2020-05-20173

Destoon添加供应内容时如何过滤手机号?
在我们为供应模板添加供应内容的时候,有时候我们不想把手机号码显示出来,增加不必要的麻烦,下面是我以供应模板为例的修改方法打开要目录文件sell/sell.class.php,找到“function add($post) { ” 字断然后在大概1

0评论2020-05-19215