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




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

默认的商品页URL为:/商品标题-p-商品ID.html' K( w  \1 S0 |3 d3 B& |
想要改为:/p-商品ID.html
# n- Q9 [# e& K实现方法:
1 M0 l! C( I$ \0 o
. r0 P; F  r- W) @- N6 F( `5 pseo.url.php文件约404行:
3 S" S- R$ B: |' h3 \) p$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], ‘.html’, $separator);
- \6 M9 z: i# R9 b1 o$ k. I改为:* j; [9 S$ o# o  n& O- L9 U
$url = $this->make_url($page, ”, $p2[0], $p2[1], ‘.html’, $separator);
/ L: [) b% C* l: V约107行:
' {1 n, ]0 K0 w3 `3 ]' E‘products_id’ => ‘-p-’,% P1 r$ Y) Q2 k3 `( n8 d# J
改为:
; Z4 ^3 v- ~5 ?+ m( L7 E‘products_id’ => ‘p-’,! X# k4 z" @$ Q1 P
修改重写规则,打开.htaccess% |' M6 U! I9 M8 s7 C/ ~
找到:# `6 g: M2 s" v% G4 Z
RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
! N  R' {6 S- V1 A改为:) t% c" ?8 G+ G2 p
RewriteRule ^(.*)p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
$ |8 g( e- E. L4 m完成。' t' s' J  h- p5 C3 I4 L2 E

4 X3 J; l1 T, c- E) j$ n: [参考:http://www.wuzone.com/715.html




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