Ecshop url重写 apache环境配置伪静态

发布时间:2025-10-04 点击:13
ecshop v2.0 以上版本 url rewrite 使用说明
*
* 一、apache 服务器
*
1、首先您需要找到 apache 安装目录,之后找到conf 目录下的 httpd.conf 文件。
2、将下面的代码复制到 httpd.conf 文件中,注意将192.168.1.102和网址,替换你自己的。本地测试可用localhost替换
<directory />
options followsymlinks
allowoverride all
order deny,allow
allow from all
satisfy all
</directory>
<virtualhost 192.168.1.102>
documentroot "d:/wamp/www"
servername www..com
<ifmodule mod_rewrite.c>
rewriteengine on
rewriterule ^(.*)/index.html$ $1/index.php
rewriterule ^(.*)/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.php
rewriterule ^(.*)/category-([0-9] )-b([0-9] )-min([0-9] )-max([0-9] )-attr([^-]*)-([0-9] )-(. )-([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 [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 ^(.*)/category-([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/article_cat.php?id=$2&page=$3&sort=$4&order=$5 [qsa,l]
rewriterule ^(.*)/article_cat-([0-9] )-([0-9] )(.*).html$ $1/article_cat.php?id=$2&page=$3 [qsa,l]
rewriterule ^(.*)/article_cat-([0-9] )(.*).html$ $1/article_cat.php?id=$2 [qsa,l]
rewriterule ^(.*)/article-([0-9] )(.*).html$ $1/article.php?id=$2 [qsa,l]
rewriterule ^(.*)/brand-([0-9] )-c([0-9] )-([0-9] )-(. )-([a-za-z] ).html $1/brand.php?id=$2&cat=$3&page=$4&sort=$5&order=$6 [qsa,l]
rewriterule ^(.*)/brand-([0-9] )-c([0-9] )-([0-9] )(.*).html $1/brand.php?id=$2&cat=$3&page=$4 [qsa,l]
rewriterule ^(.*)/brand-([0-9] )-c([0-9] )(.*).html $1/brand.php?id=$2&cat=$3 [qsa,l]
rewriterule ^(.*)/brand-([0-9] )(.*).html $1/brand.php?id=$2 [qsa,l]
rewriterule ^(.*)/tag-(.*).html $1/search.php?keywords=$2 [qsa,l]
rewriterule ^(.*)/snatch-([0-9] ).html$ $1/snatch.php?id=$2 [qsa,l]
rewriterule ^(.*)/group_buy-([0-9] ).html$ $1/group_buy.php?act=view&id=$2 [qsa,l]
rewriterule ^(.*)/auction-([0-9] ).html$ $1/auction.php?act=view&id=$2 [qsa,l]
rewriterule ^(.*)/exchange-id([0-9] )(.*).html$ $1/exchange.php?id=$2&act=view [qsa,l]
rewriterule ^(.*)/exchange-([0-9] )-min([0-9] )-max([0-9] )-([0-9] )-(. )-([a-za-z] )(.*).html$ $1/exchange.php?cat_id=$2&integral_min=$3&integral_max=$4&page=$5&sort=$6&order=$7 [qsa,l]
rewriterule ^(.*)/exchange-([0-9] )-([0-9] )-(. )-([a-za-z] )(.*).html$ $1/exchange.php?cat_id=$2&page=$3&sort=$4&order=$5 [qsa,l]
rewriterule ^(.*)/exchange-([0-9] )-([0-9] )(.*).html$ $1/exchange.php?cat_id=$2&page=$3 [qsa,l]
rewriterule ^(.*)/exchange-([0-9] )(.*).html$ $1/exchange.php?cat_id=$2 [qsa,l]
</ifmodule>
</virtualhost>
3、在 httpd.conf 中搜索loadmodule rewrite_modu

awifi是什么
导购网站 云服务器配置
京东再出手 jd.ren收入囊中
撤回商标注册申请需要什么资料
文件解压没有反应请解压-虚拟主机/数据库问题
云服务器租用是什么
485云服务器哪里便宜
解析解析都没有问题之前也是正常的访问被系统拦截