$7.49 .com domain with free InstantPage Website Builder$1.99 Web Hosting   捷飞网络官方淘宝店   Godaddy 优惠码
返回列表 发帖
分享到:




[开发经验技巧分享] 修改Zen Cart Ultimate SEO URLs 模块商品页URL重写地址

默认的商品页URL为:/商品标题-p-商品ID.html8 q# \; a: K( S: f- O- {1 I
想要改为:/p-商品ID.html
6 Q$ d4 q5 d4 }# s实现方法:: h+ k# T1 \$ z# f
( V0 i% n; W2 O
seo.url.php文件约404行:% O* f( D: Y3 c6 b+ u% z6 P
$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], ‘.html’, $separator);
; P; A0 h4 k* M改为:
1 R5 S8 n" B4 U# k/ |0 [( Q$url = $this->make_url($page, ”, $p2[0], $p2[1], ‘.html’, $separator);
: u1 O. N& H+ @6 N1 \* a4 q约107行:
2 ~6 [: m, n+ N# b; |* P3 E6 g- U‘products_id’ => ‘-p-’,
* y' r7 p, i- N改为:
9 u" ]5 y. U+ L6 H  L‘products_id’ => ‘p-’,7 m0 R8 Y# H2 Z0 m: A
修改重写规则,打开.htaccess, b+ H( T$ W, g
找到:9 o9 e/ A. g8 U, \
RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]4 f$ D% f2 S) X( u8 [% @
改为:
5 c3 S9 A/ G  p) O. ^RewriteRule ^(.*)p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]( e' k* u5 c% O/ ?; T
完成。" a9 i# w( E& A+ g  o

5 A* F: _* C: S& H: W1 C+ H参考:http://www.wuzone.com/715.html

返回列表
Namecheap
Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting
互联网安全