伪静态设置-PHPCMS教程

来源:模板无忧 作者:yanyi2008 更新时间:2007-07-04 点击:

1.IIS 下伪静态设置

首先请下载以下附件: IIS Rewrite模块 附件:Rewrite.rar

其中httpd.ini为配置文件内容如下:

[ISAPI_Rewrite]

# 3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32

# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP

# Rewrite 系统规则请勿修改 PHPCMS3.0
RewriteRule ^(.*)/show-([0-9] )-([0-9] )\.html$ $1/show\.php\?itemid=$2&page=$3
RewriteRule ^(.*)/list-([0-9] )-([0-9] )\.html$ $1/list\.php\?catid=$2&page=$3
RewriteRule ^(.*)/show-([0-9] )\.html$ $1/show\.php\?specialid=$2


将其解压到任意目录,如: C:\Rewrite

打开“控制面板→治理工具→IIS信息服务治理器→网站→您的站点→属性”。在“ISAPI筛选器”项点击 “添加”, 筛选器名称填入Rewrite,可执行文件为C:\Rewrite\Rewrite.dll (假如您解压到其它目录请填入相应地址)

重新启动IIS.

看到状态为向上时成功。

2.Apache 下伪静态设置

请首先咨询您的空间服务商,空间是否支持 Rewrite 以及是否支持对站点目录中 .htaccess 的文件解析,否则即便按照下面的方法设置好了,也无法使用。(需要服务器支持Apache的Mod_Rewrite功能)

服务器端设置 rewrite:

1,虚拟主机用户:

------------------------------------------------------------------------

打开文件httpd.conf 文件(apache目录下面的文件)

以apache2.2.3设置为例,配置虚拟主机下的rewrite


在主目录里面需要添加代码 AllowOverride Options FileInfo

取消 LoadModule rewrite_module modules/mod_rewrite.so前面的 #

重新启动Apache.

-------------------------------------------------------------------------

Apache Web Server(独立主机用户)

首先确定您使用的 Apache 版本,及是否加载了 mod_rewrite 模块。

< Prev12 Next >
相关PHPCMS教程:
最新评论:
loading.. 评论加载中....
发表评论:不能超过250字节,请自觉遵守互联网相关政策法规.
  • 昵称: 验证:

最新PHPCMS教程