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




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

默认的商品页URL为:/商品标题-p-商品ID.html' Y/ [- v& J/ X: f  R5 }
想要改为:/p-商品ID.html
) ?& h8 Y; }( ^$ N实现方法:
+ }, I% s; ~) |2 z& U4 ~* b( X- o' F7 M$ S
seo.url.php文件约404行:: g* l0 k, N, A* u  i5 c
$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], ‘.html’, $separator);
$ U  N1 N* ^4 I% X; n7 I2 ~改为:1 Y! z, @3 R8 W2 Q
$url = $this->make_url($page, ”, $p2[0], $p2[1], ‘.html’, $separator);
9 P+ n4 q- q9 l; {约107行:
' |$ |, s: v4 E" `# O# s1 V‘products_id’ => ‘-p-’,3 V) w, Z$ \1 Z8 g6 }' R5 l# f
改为:2 X! r+ l; N- ^6 U: V
‘products_id’ => ‘p-’,
! R. ?+ I2 a8 k修改重写规则,打开.htaccess( P; z1 `# G3 P: q, `7 }6 s
找到:
8 _$ f" _1 E. y0 ^$ A3 m; y8 GRewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]5 F# x: c* }9 \
改为:
. R8 |8 j6 n# L- O' D+ |; bRewriteRule ^(.*)p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
9 M# O" E3 ]- s! j" d: b( n7 A% K完成。4 C7 e3 v( e# T- m- i; A7 J5 y
& N9 z7 k8 m) V9 C( l
参考:http://www.wuzone.com/715.html

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