OpenCart - 中文论坛

标题: opencart主页-联系我们-注册登录等页面进行URL伪静态化 [打印本页]

作者: sunboy    时间: 2014-3-7 16:35
标题: opencart主页-联系我们-注册登录等页面进行URL伪静态化
对网站主页,联系我们,注册登录等页面进行URL伪静态化(oc1.5.6测试通过)

首先安装vqmod插件,不会的请看帖:https://opencart.cn/thread-9410-1-1.html

1,将vqmod_seo_url.xml拷贝到vqmod\xml目录下面,在后台开启(高级URL Rewrite's),将htaccess.txt 文件重命名为 .htaccess,如果网页不在根目录下就将RewriteBase /后面加上网页所在文件夹名称,比如RewriteBase /opencart,改为后保存.htaccess文件。


2,在数据表`url_alias`里面加入相关seo数据,比如:
    Query                   keyword
    account=account         account.html


3, 接下来只要在地址栏中输入 https://127.0.0.1/opencart/+ 数据库keyword的值就可以访问对应页面了。



为了方便大家一次性导入keyword,我把sql语句贴出来,只要在数据库运行一下就行。

INSERT INTO url_alias (query, keyword) VALUES ('common/home', '');
INSERT INTO url_alias (query, keyword) VALUES ('account/wishlist', 'wishlist');
INSERT INTO url_alias (query, keyword) VALUES ('account/account', 'my-account');
INSERT INTO url_alias (query, keyword) VALUES ('checkout/cart', 'shopping-cart');
INSERT INTO url_alias (query, keyword) VALUES ('checkout/checkout', 'checkout');
INSERT INTO url_alias (query, keyword) VALUES ('account/login', 'login');
INSERT INTO url_alias (query, keyword) VALUES ('account/logout', 'logout');
INSERT INTO url_alias (query, keyword) VALUES ('account/order', 'order-history');
INSERT INTO url_alias (query, keyword) VALUES ('account/newsletter', 'newsletter');
INSERT INTO url_alias (query, keyword) VALUES ('product/special', 'specials');
INSERT INTO url_alias (query, keyword) VALUES ('affiliate/account', 'affiliates');
INSERT INTO url_alias (query, keyword) VALUES ('checkout/voucher', 'gift-vouchers');
INSERT INTO url_alias (query, keyword) VALUES ('product/manufacturer', 'brands');
INSERT INTO url_alias (query, keyword) VALUES ('information/contact', 'contact-us');
INSERT INTO url_alias (query, keyword) VALUES ('account/return/insert', 'request-return');
INSERT INTO url_alias (query, keyword) VALUES ('information/sitemap', 'sitemap');
INSERT INTO url_alias (query, keyword) VALUES ('account/forgotten', 'forgot-password');
INSERT INTO url_alias (query, keyword) VALUES ('account/download', 'downloads');
INSERT INTO url_alias (query, keyword) VALUES ('account/return', 'returns');
INSERT INTO url_alias (query, keyword) VALUES ('account/transaction', 'transactions');
INSERT INTO url_alias (query, keyword) VALUES ('account/register', 'create-account');
INSERT INTO url_alias (query, keyword) VALUES ('product/compare', 'compare-products');
INSERT INTO url_alias (query, keyword) VALUES ('product/search', 'search');
INSERT INTO url_alias (query, keyword) VALUES ('account/edit', 'edit-account');
INSERT INTO url_alias (query, keyword) VALUES ('account/password', 'change-password');
INSERT INTO url_alias (query, keyword) VALUES ('account/address', 'address-book');
INSERT INTO url_alias (query, keyword) VALUES ('account/reward', 'reward-points');
INSERT INTO url_alias (query, keyword) VALUES ('affiliate/edit', 'edit-affiliate-account');
INSERT INTO url_alias (query, keyword) VALUES ('affiliate/password', 'change-affiliate-password');
INSERT INTO url_alias (query, keyword) VALUES ('affiliate/payment', 'affiliate-payment-options');
INSERT INTO url_alias (query, keyword) VALUES ('affiliate/tracking', 'affiliate-tracking-code');
INSERT INTO url_alias (query, keyword) VALUES ('affiliate/transaction', 'affiliate-transactions');
INSERT INTO url_alias (query, keyword) VALUES ('affiliate/logout', 'affiliate-logout');
INSERT INTO url_alias (query, keyword) VALUES ('affiliate/forgotten', 'affiliate-forgot-password');
INSERT INTO url_alias (query, keyword) VALUES ('affiliate/register', 'create-affiliate-account');
INSERT INTO url_alias (query, keyword) VALUES ('affiliate/login', 'affiliate-login');

主页-联系我们-注册登录等页面进行URL伪静态化.rar

1.7 KB, 下载次数: 278

opencart-seo


作者: yuanlikang    时间: 2016-7-15 11:05
行不行啊




欢迎光临 OpenCart - 中文论坛 (https://bbs.opencart.cn/) Powered by Discuz! X3.2