修改seo url中去掉产品id的方法

以前用Ultimate SEO URLs模块 产品地址是这样的
http://www.xxx.com/产品名-p-101.html
通过下面方法我们改成这样的格式
http://www.xxx.com/产品名/

修改方法如下
1.includes/init_includes/init_category_path.php(原先是includes/modules/pages/product_info/header_php.php 但不能引用到导航)
头部添加if(zen_not_null($_GET['products_name'])){ $products_id_query=$db->Execute("select products_id from ".TABLE_PRODUCTS_DESCRIPTION.' where products_name="'.str_replace("-"," ",$_GET['products_name']).'"'); if($products_id_query->RecordCount()>0) $_GET['products_id']=$products_id_query->fields['products_id']; }2.includes/classes/seo.url.php
约401行查找$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], '.html', $separator);替换为$url = $this->make_url($page, zen_get_categories_name_from_product($p2[1]).'/'.$this->get_product_name($p2[1]),'', '', '/', '');3.htaccess
查找RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]替换为RewriteRule ^(.*)\/(.*)\/$ index\.php?main_page=product_info&products_name=$2&%{QUERY_STRING} [L]注:这次后台就可以直接访问了 当然有两级目录的话就不行