ECSHOP商品自定义URL
设置伪静态,输出的URL是fenlei1\001.htmfenlei2\002.htm每个商品都在各自分类的自定义URL下如何设置设置为fenlei\001.htmfen...
设置伪静态,输出的URL是 fenlei1\001.htm fenlei2\002.htm 每个商品都在各自分类的自定义URL下
如何设置设置为 fenlei\001.htm fenlei\002.htm 所有商品都在同一个目录?
break;
case 'goods':
if (empty($gid))
{
return false;
}
else
{
$sql="select c.cat_id, c.define_url , g.define_url AS goods_url from ". $GLOBALS['ecs']->table('goods') ." AS g left join " . $GLOBALS['ecs']->table('category') . " AS c on g.cat_id=c.cat_id where g.goods_id='$gid' limit 0,1";
$cat_array = $GLOBALS['db']->getRow($sql);
$define_url_cat = $cat_array['define_url'] ? $cat_array['define_url'].'/' : 'category-'.$cat_array['cat_id'].'/';
$define_url_goods = $cat_array['goods_url'] ? $cat_array['goods_url'] : $gid ;
$uri = $rewrite ? ($define_url_cat . $define_url_goods) : ('goods.php?id=' . $gid);
}
RewriteRule ^(?:[0-9a-zA-Z_]+)/([0-9a-zA-Z_-]+)(.*)\.html$ goods\.php\?defurl=$1 [QSA,L] 展开
如何设置设置为 fenlei\001.htm fenlei\002.htm 所有商品都在同一个目录?
break;
case 'goods':
if (empty($gid))
{
return false;
}
else
{
$sql="select c.cat_id, c.define_url , g.define_url AS goods_url from ". $GLOBALS['ecs']->table('goods') ." AS g left join " . $GLOBALS['ecs']->table('category') . " AS c on g.cat_id=c.cat_id where g.goods_id='$gid' limit 0,1";
$cat_array = $GLOBALS['db']->getRow($sql);
$define_url_cat = $cat_array['define_url'] ? $cat_array['define_url'].'/' : 'category-'.$cat_array['cat_id'].'/';
$define_url_goods = $cat_array['goods_url'] ? $cat_array['goods_url'] : $gid ;
$uri = $rewrite ? ($define_url_cat . $define_url_goods) : ('goods.php?id=' . $gid);
}
RewriteRule ^(?:[0-9a-zA-Z_]+)/([0-9a-zA-Z_-]+)(.*)\.html$ goods\.php\?defurl=$1 [QSA,L] 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询