ECMall 2.1 以上版本 URL 重写使用说明
=============================================================================== php
URL重写技术可让你的网站具备更高的可用性和友好性。同时经过 URL 重写还能有效
的提升网站内容在搜索引擎的收录率。 html
下面分别介绍在 Apache 服务器以及 IIS 服务器下的使用方法: api
1、Apache 服务器
------------------------------------------------------------------------------- 服务器
一、首先您须要找到 Apache 安装目录,以后找到 conf 目录下的 httpd.conf 文件。
二、将下面的代码复制到 httpd.conf 文件中,注意将 /ecmall 替换为您的商店的实际
安装目录。 app
<Directory /ecmall> ide
//个人是这样的D:/xampp-win32-1.7.1-beta3/xampp-win32-1.7.1-beta3/xampp/htdocs/ecmall/upload
Options FollowSymLinks
AllowOverride All
</Directory> 工具
三、在 httpd.conf 中搜索 LoadModule rewrite_module,将该行前面的 # 号删除。
若是您的 Apache 是1.3.x版本还须要查找 AddModule mod_rewrite.c,
请将前面的#删除。 测试
四、保存 httpd.conf。
五、将 ecmall 目录下的 htaccess.txt 重命名为 .htaccess。 网站
/能够用一些工具里面有一些方法 不是空文件 因此不能随便复制一个
六、从新启动 Apache。
七、进入 ECMall 管理中心->网站设置->系统设置,将 启用伪静态 设置为“是”。 搜索引擎
2、IIS 服务器
-------------------------------------------------------------------------------
一、首先请进入如下网址 http://www.helicontech.com/download/,下载免费版的
ISAPI_Rewrite组件:ISAPI_Rewrite Lite ( freeware )。若是您仅仅是测试用途使用
这个就足够了,若是您是商业应用建议您购买完整版的 ISAPI_Rewrite Full。
二、点击下载到本地的文件 isapi_rwl_x86_0064.msi (该文件名和您下载的版本有关)
进行安装,安装成功以后进入安装目录(默认在
C:/Program Files/Helicon/ISAPI_Rewrite)找到httpd.ini文件,点击右键将文件只读
属性去掉。而后进入:开始菜单->程序->Helicon->ISAPI_Rewrite->httpd.ini,
点击打开 httpd.ini 文件。
三、复制下面的内容到httpd.ini文件
-----内容开始,不要复制本行-----
[ISAPI_Rewrite]
# 为了确保重写规则不影响服务器上的其余站点
# 请将下面的语句前的#号去掉,并将(?:www\.)?site1\.com改成商店所在域名
#RewriteCond %{HTTP:Host} (?:www\.)?site1\.com
RewriteRule ^goods/([0-9]+)/?$ index.php?app=goods&id=$1 [I]
RewriteRule ^goods/([0-9]+)/([^/]+)/?$ index.php?app=goods&id=$1&act=$2 [I]
RewriteRule ^goods/([0-9]+)/([^/]+)/page_([^/]+)/?$ index.php?app=goods&id=$1&act=$2&page=$3 [I]
RewriteRule ^groupbuy/([0-9]+)/?$ index.php?app=groupbuy&id=$1 [I]
RewriteRule ^category/goods/?$ index.php?app=category [I]
RewriteRule ^category/(.*)/?$ index.php?app=category&act=$1 [I]
RewriteRule ^brand/?$ index.php?app=brand [I]
RewriteRule ^article/([0-9]+).html$ index.php?app=article&act=view&article_id=$1 [I]
RewriteRule ^store/([0-9]+)/?$ index.php?app=store&id=$1 [I]
RewriteRule ^store/article/([0-9]+).html$ index.php?app=store&act=article&id=$1 [I]
RewriteRule ^store/([0-9]+)/credit/?$ index.php?app=store&id=$1&act=credit [I]
RewriteRule ^store/([0-9]+)/credit/page_([^/]+)/?$ index.php?app=store&id=$1&act=credit&page=$2 [I]
RewriteRule ^store/([0-9]+)/credit/([0-9]+)/?$ index.php?app=store&id=$1&act=credit&eval=$2 [I]
RewriteRule ^store/([0-9]+)/credit/([0-9]+)/page_([^/]+)/?$ index.php?app=store&id=$1&act=credit&eval=$2&page=$3 [I]
RewriteRule ^store/([0-9]+)/goods/?$ index.php?app=store&id=$1&act=search [I]
RewriteRule ^store/([0-9]+)/goods/page_([^/]+)/?$ index.php?app=store&id=$1&act=search&page=$2 [I]
RewriteRule ^store/([0-9]+)/category/([0-9]+)/?$ index.php?app=store&id=$1&act=search&cate_id=$2 [I]
RewriteRule ^store/([0-9]+)/category/([0-9]+)/page_([^/]+)/?$ index.php?app=store&id=$1&act=search&cate_id=$2&page=$3 [I]
RewriteRule ^store/([0-9]+)/groupbuy/?$ index.php?app=store&id=$1&act=groupbuy [I]
RewriteRule ^store/([0-9]+)/groupbuy/page_([^/]+)/?$ index.php?app=store&id=$1&act=groupbuy&page=$2 [I]
-----内容结束,不要复制本行-----
四、保存 httpd.ini,进入 ECMall 管理中心->网站设置->系统设置,将 启用伪静态设置为“是”。