1、修改源文件:catalog/controller/startup/seo_url.php,大概103行,添加如下代码:
else{
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" . $this->db->escape($data['route']) . "'");
if ($query->num_rows) {
$url .= '/' . $query->row['keyword'];
unset($data[$key]);
}
}
2、数据库插入记录:
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('common/home', '');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/wishlist', 'wishlist.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/account', 'my-account.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('checkout/cart', 'shopping-cart.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('checkout/checkout', 'checkout.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/login', 'login.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/logout', 'logout.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/order', 'order-history.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/newsletter', 'newsletter.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('product/special', 'specials.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('affiliate/account', 'affiliates.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('checkout/voucher', 'gift-vouchers.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('product/manufacturer', 'brands.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('information/contact', 'contact.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/return/insert', 'request-return.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('information/sitemap', 'sitemap.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/forgotten', 'forgot-password.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/download', 'downloads.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/return', 'returns.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/transaction', 'transactions.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/register', 'register.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('product/compare', 'compare-products.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('product/search', 'search.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/edit', 'edit-account.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/password', 'change-password.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/address', 'address-book.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('account/reward', 'reward-points.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('affiliate/edit', 'edit-affiliate-account.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('affiliate/password', 'change-affiliate-password.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('affiliate/payment', 'affiliate-payment-options.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('affiliate/tracking', 'affiliate-tracking-code.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('affiliate/transaction', 'affiliate-transactions.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('affiliate/logout', 'affiliate-logout.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('affiliate/forgotten', 'affiliate-forgot-password.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('affiliate/register', 'create-affiliate-account.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('affiliate/login', 'affiliate-login.html');
INSERT INTO oc_url_alias (`query`, `keyword`) VALUES ('common/currency/currency', 'common-currency-currency.html');
3、后台开启伪静态,并且服务器要开启伪静态支持