ec-cube中商品カテゴリー的靜態網址

昨天只做了detail的靜態網址
今天無意間發現這篇
參考了一下把カテゴリー的靜態網址也弄出來了

RewriteEngine On
RewriteRule detail¥/([0-9]+)/? /onlineshop/products/detail.php?product_id=$1 [L]
RewriteRule list/([0-9]+)/? /onlineshop/products/list.php?category_id=$1 [L]

\data\Smarty\templates\mystyle\bloc\category.tpl

44
<li class="level<!--{$level}--><!--{if in_array($arrTree[cnt].category_id, $tpl_category_id) }--> onmark<!--{/if}-->"><a href="<!--{$smarty.const.URL_DIR}-->products/list/<!--{$arrTree[cnt].category_id}-->"<!--{if in_array($arrTree[cnt].category_id, $tpl_category_id) }--> class="onlink"<!--{/if}-->><!--{$arrTree[cnt].category_name|escape}-->(<!--{$arrTree[cnt].product_count|default:0}-->)</a>

他只有說要改這個
但我改了\html\user_data\packages\mystyle\bloc\category.tpl後才有作用

25
<li class="level<!--{$level}--><!--{if in_array($arrTree[cnt].category_id, $tpl_category_id) }--> onmark<!--{/if}-->"><a href="<!--{$smarty.const.URL_DIR}-->products/list/<!--{$arrTree[cnt].category_id}-->"<!--{if in_array($arrTree[cnt].category_id, $tpl_category_id) }--> class="onlink"<!--{/if}-->><!--{$arrTree[cnt].category_name|escape}-->(<!--{$arrTree[cnt].product_count|default:0}-->)</a>

\data\class\pages\LC_Page_Sitemap.php
把昨天書上沒提到的stiemap也補一下
繼續閱讀

ec-cube中商品detail的靜態網址

恩 又是seo… 又是rewrite…..
以下是參考ec-cube公式ガイドブック用的….
首先當然是確定自己的server有mod_rewrite囉
然後在/html/.htaccess
加入(我是用dreamweaver編輯 因為用記事本光開 存 上傳..就壞了@@)

RewriteEngine On
RewriteRule detail¥/([0-9]+)/? /onlineshop/products/detail.php?product_id=$1

然後在管理系統中(直接修改mysql會沒有效果)
基本情報管理->パラメータ設定->DETAIL_P_HTML
改成:

URL_DIR . "products/detail/"

最後打開\data\Smarty\templates\mystyle\list.tpl

130
<a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProducts[cnt].product_id}-->/" onmouseover="chgImg('<!--{$TPL_DIR}-->img/products/b_detail_on.gif','<!--{$name}-->');" onmouseout="chgImg('<!--{$TPL_DIR}-->img/products/b_detail.gif','<!--{$name}-->');">

只是多加一個’/’而已
做完就可以測試拉^^