完成ecshop自定义目录结构伪静态url
2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家
ecshop自定义目录结构伪静态url,这个功能是非常多的人想要的,其实很简单,。就是在ecshop后台商品编辑录入的时候。或者是ecshop商品分类录入编辑的时候,可以自定义目录结构,让自己的商品地址url以及分类地址url看上去,更加的个性化。下面我们将结合ecshop的数据库处理以及php程序处理,来完成ecshop自定义目录结构伪静态url。 1:修改ecshop商品表ecs_goods,ecs_category的 ecshop数据库结构,增加url 字段 alter table ecs_goods add column url varchar(128) not null default ''; alter table ecs_category add column url varchar(128) not null default ''; 2:admin/goods.php修改以下代码 $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_name_style, goods_sn, " . "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " . "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " . "seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, " . "is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, rank_integral, suppliers_id,url)" . "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " . "'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ". "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ". "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',". " '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_on_sale', '$is_alone_sale', $is_shipping, ". " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral', '$suppliers_id','$_POST[url]')"; 3:admin/category.php修改以下代码 $cat['url'] = !empty($_POST['url']) ? trim($_POST['url']) : ''; 4:调整url规则,以下是apache下面的规则 RewriteRule ^(.*?)\/([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9 [QSA,L] RewriteRule ^(.*?)\/([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$ category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6 [QSA,L] RewriteRule ^(.*?)\/([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$category\.php\?id=$2&brand=$3&page=$4&sort=$5&order=$6 [QSA,L] RewriteRule ^(.*?)\/([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$ category\.php\?id=$2&brand=$3&page=$4[QSA,L] RewriteRule ^(.*?)\/([0-9]+)-b([0-9]+)(.*)\.html$ category\.php\?id=$2&brand=$3[QSA,L] RewriteRule ^(.*?)\/([0-9]+)(.*)\.html$category\.php\?id=$2[QSA,L] hongbsyu181.com haiwxyu891.com yonglech561.com wangziylc891.com baiheyle691.com RewriteRule ^(.*?)\/([0-9]+)$goods\.php\?id=$2 [QSA,L] |
最近更新
常用插件
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop2.7.1打印发货单插件
ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs...
- ecshop分类批量扩展插件
ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
- ecshop二次开发详细页面生
插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人...