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




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

默认的商品页URL为:/商品标题-p-商品ID.html
* _- s* H6 i6 z4 W* o; _+ Z想要改为:/p-商品ID.html# v2 J+ }& ]$ u
实现方法:/ m8 ^0 r9 P8 {/ s
' S! X! m5 h+ E# D
seo.url.php文件约404行:
4 g; p7 q: ]5 ?' z8 S$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], ‘.html’, $separator);" g! _8 c5 ]' O! j9 j: f" k- [
改为:
$ e# u% ^; z0 k( o7 q$url = $this->make_url($page, ”, $p2[0], $p2[1], ‘.html’, $separator);: G4 C: q$ h& v4 N3 e
约107行:
, E4 B9 Z9 e8 [2 u. ?! D7 p5 |‘products_id’ => ‘-p-’,6 x5 V/ ]+ T$ n6 \
改为:3 d- _: l/ c; \4 p7 A
‘products_id’ => ‘p-’,, x  z9 V! D! `. E2 E$ d
修改重写规则,打开.htaccess4 A. i( t$ W% R) u. {2 `
找到:1 _4 V; u) `8 B1 n- ~) o
RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]4 w+ n4 I4 G5 w) _. O& H
改为:; T* j0 l5 c* u. S; E3 P( E7 m
RewriteRule ^(.*)p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
: m, b) }) H/ a5 k9 Q4 O完成。( J! }& P. P1 U5 N
% b" `, a! N# N; V7 A
参考:http://www.wuzone.com/715.html


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