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




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

默认的商品页URL为:/商品标题-p-商品ID.html7 s  H: r6 M2 P, k) q, p
想要改为:/p-商品ID.html/ z3 ~% Z3 d0 W' w! _' B1 B; N
实现方法:& A6 ]) u4 \! T

& v& z2 ?) g. ]) y" Bseo.url.php文件约404行:( E9 ?( b5 Z8 M4 ^
$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], ‘.html’, $separator);
; H6 o9 o  |, {7 p8 g5 i3 b% ?; k% e改为:4 l; [! V) ?* M6 E" Q
$url = $this->make_url($page, ”, $p2[0], $p2[1], ‘.html’, $separator);! _( F1 l" z! v0 @! n! t8 J; H
约107行:0 _( J2 N# R* X6 y! [
‘products_id’ => ‘-p-’,7 n- M8 {6 s  j/ N
改为:2 n( @; K2 g  @. ^
‘products_id’ => ‘p-’,
7 H( J% |  o( g: |' ]1 J修改重写规则,打开.htaccess0 t) \. V) i! L* G" @
找到:
9 ~: B5 Q* K! w/ d; Q. ~RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]: e1 u( O. y1 F4 F
改为:! z/ |  S( I6 c0 [- D5 p. K8 S% H3 ^
RewriteRule ^(.*)p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]0 D/ x7 H9 u. y* r6 O
完成。
9 g& f# ~1 Z# V" z$ W1 E" t, Z& F7 C
参考:http://www.wuzone.com/715.html

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