欢迎来到天天文库
浏览记录
ID:11133266
大小:37.50 KB
页数:4页
时间:2018-07-10
《解决ecshop实现url重写伪静态和全静态》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、ECshop2.7.2实现简单URL重写-伪静态及全静态*一、找到Apache服务器1、首先您需要找到Apache安装目录,之后找到conf目录下的httpd.conf文件。2、将下面的代码复制到httpd.conf文件中,注意将/ecshop替换为您的商店的实际安装目录。OptionsFollowSymLinksAllowOverrideAll3、在httpd.conf中搜索LoadModulerewrite_module,将该行前面的#号删除。如果您的Apache是1.3.x版本还需要查找AddModu
2、lemod_rewrite.c,请将前面的#删除。4、保存httpd.conf。5、将ecshop目录下的htaccess.txt重命名为.htaccess。(windows下用记事本打开然后另存为为.htaccess。)6、重新启动Apache。7、进入ecshop管理中心->商店设置,将URL简单重写设置为启用。如果您想通过httpd.conf来设置重写规则,请按照下面的步骤操作:1、执行上面第1-3步操作。2、找到您的商店所在的虚拟主机段,如:DocumentRoot"D:/php/xampp/htdocs"##EachdirectorytowhichApac
3、hehasaccesscanbeconfiguredwithrespect#towhichservicesandfeaturesareallowedand/ordisabledinthat#directory(anditssubdirectories).##First,weconfigurethe"default"tobeaveryrestrictivesetof#features.3、将下面的内容加入在此段代码后面。RewriteEngineOnRewriteRule^(.*)/index.html$$1/index.
4、phpRewriteRule^(.*)/category$$1/index.php[L]RewriteRule^(.*)/feed-c([0-9]+).xml$$1/feed.php?cat=$2[L]RewriteRule^(.*)/feed-b([0-9]+).xml$$1/feed.php?brand=$2[L]RewriteRule^(.*)/feed.xml$$1/feed.phpRewriteRule^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)
5、-(.+)-([a-zA-Z]+)(.*).html$$1/category.php?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9[QSA,L]RewriteRule^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*).html$$1/category.php?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr
6、=$6[QSA,L]RewriteRule^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$$1/category.php?id=$2&brand=$3&page=$4&sort=$5&order=$6[QSA,L]RewriteRule^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*).html$$1/category.php?id=$2&brand=$3&page=$4[QSA,L]RewriteRule^(.*)/categor
7、y-([0-9]+)-b([0-9]+)(.*).html$$1/category.php?id=$2&brand=$3[QSA,L]RewriteRule^(.*)/category-([0-9]+)(.*).html$$1/category.php?id=$2[QSA,L]RewriteRule^(.*)/goods-([0-9]+)(.*).html$$1/goods.php?id=$2[QSA,L]RewriteRule^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$$1
此文档下载收益归作者所有