321.. Posted April 23, 2010 Share Posted April 23, 2010 原来生成的是:http://xxx.xxx.xxxx/344-ugg-classic-tall-romantic-flower.html我想修改成:http://xxx.xxx.xxxx/ugg-classic-tall-romantic-flower-344.html就是ID 放在后面.htaccess文件的生成规则已经修改了 就是程序里面的链接怎么修改 好像是link.php里面修改的吧 public function getProductLink($id_product, $alias = NULL, $category = NULL, $ean13 = NULL) { if (!isset($this->allow)) $this->allow = 0; if (is_object($id_product)) return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.(($id_product->category != 'home' AND !empty($id_product->category)) ? $id_product->category.'/' : '').intval($id_product->id).'-'.$id_product->link_rewrite.($id_product->ean13 ? '-'.$id_product->ean13 : '').'.html') : (_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product->id)); elseif ($alias) return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.(($category AND $category != 'home') ? ($category.'/') : '').intval($id_product).'-'.$alias.($ean13 ? '-'.$ean13 : '').'.html') : (_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product)); else return _PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product); }请高手指教 Link to comment Share on other sites More sharing options...
321.. Posted April 24, 2010 Author Share Posted April 24, 2010 ...自己搞定了...这边都没人气呀... Link to comment Share on other sites More sharing options...
21846657 Posted April 24, 2010 Share Posted April 24, 2010 唉...我想,是因为大多数人都只会“求鱼”,而不愿“学渔”吧。另外,你是怎么搞定的?是同时修改Link.php里的public getProductLink function和AdminGenerator.php里的public function _getHtaccessContent吧?我记得有一个叫URL Rewritting的第三方开源插件——不晓得它能不能实现——如果能,尽量不要修改官方源码。 Link to comment Share on other sites More sharing options...
321.. Posted April 24, 2010 Author Share Posted April 24, 2010 AdminGenerator.php里面的public function _getHtaccessContent是在生成.htaccess的时候使用的 没有重新生成的话 里面的代码不改也没事只要修改Link.php里面的public getProductLink function就可以了 规则设置成和.htaccess一样就OK了 Link to comment Share on other sites More sharing options...
321.. Posted April 24, 2010 Author Share Posted April 24, 2010 唉...我想,是因为大多数人都只会“求鱼”,而不愿“学渔”吧。另外,你是怎么搞定的?是同时修改Link.php里的public getProductLink function和AdminGenerator.php里的public function _getHtaccessContent吧?我记得有一个叫URL Rewritting的第三方开源插件——不晓得它能不能实现——如果能,尽量不要修改官方源码。 URL Rewritting插件我有看到过,里面配置信息就一个URL 没有任何设置的地方...不知道干啥用的...呵呵 Link to comment Share on other sites More sharing options...
21846657 Posted April 24, 2010 Share Posted April 24, 2010 AdminGenerator.php里面的public function _getHtaccessContent是在生成.htaccess的时候使用的 没有重新生成的话 里面的代码不改也没事只要修改Link.php里面的public getProductLink function就可以了 规则设置成和.htaccess一样就OK了 要同时修改的。第一次生成.htaccess,也是调用AdminGenerator.php里面的public function _getHtaccessContent。实际上,以后再override,也还是要改。 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now