在iis6.0用rewrite做伪静态
大家都知道伪静态有利于seo。现在很多网上下载的源码,很多人会把网站源码支不支持静态或者伪静态也作为是否使用这套源码的标准了。
伪静态的制作方法:
下载并安装重写组件(ISAPI_Rewrite3_0056_Lite.zip)注意了要下载lite版本,因为只有这个版本才是免费的。下载地址
如下:http://www.helicontech.com/download-isapi_rewrite3.htm
下载并安装重写组件(ISAPI_Rewrite3_0056_Lite.zip)注意了要下载lite版本,因为只有这个版本才是免费的。下载地址
如下:http://www.helicontech.com/download-isapi_rewrite3.htm
配置iis6.0使其支持url重写
![在iis6.0用rewrite做伪静态](http://faq.comsenz.com/attachments/2008/05/5_200805091525441kE9q.gif)
![在iis6.0用rewrite做伪静态](http://faq.comsenz.com/attachments/2008/05/5_200805091525443RpP6.gif)
![在iis6.0用rewrite做伪静态](http://faq.comsenz.com/attachments/2008/05/5_200805091525444X8co.gif)
![在iis6.0用rewrite做伪静态](http://faq.comsenz.com/attachments/2008/05/5_200805091525446DkFo.gif)
到此你的服务器已经支持伪静态了
![在iis6.0用rewrite做伪静态](http://faq.comsenz.com/attachments/2008/05/5_200805091525441kE9q.gif)
![在iis6.0用rewrite做伪静态](http://faq.comsenz.com/attachments/2008/05/5_200805091525442RzAq.gif)
![在iis6.0用rewrite做伪静态](http://faq.comsenz.com/attachments/2008/05/5_200805091525443RpP6.gif)
![在iis6.0用rewrite做伪静态](http://faq.comsenz.com/attachments/2008/05/5_200805091525444X8co.gif)
![在iis6.0用rewrite做伪静态](http://faq.comsenz.com/attachments/2008/05/5_200805091525446DkFo.gif)
![在iis6.0用rewrite做伪静态](http://faq.comsenz.com/attachments/2008/05/5_200805091525447xx5y.gif)
到此你的服务器已经支持伪静态了
再安装ISAPI_Rewrite目录下找到httpd.ini文件,然后编写规则
详细内容参考:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
详细内容参考:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
#下边的正则表达式是匹配网站的
RewriteRule ^/([a-zA-Z0-9\_]+?)\.html$ /$1\.asp
RewriteRule ^/news\/([0-9]+?)\.html$ /newslist\.asp\?lmtype\=$1
RewriteRule ^/new\/([0-9]+?)\.html$ /info\.asp\?aboutid\=$1
RewriteRule ^/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)\.html$ /$1/$2\.asp
#RewriteRule ^/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)/([a-zA-Z0-9\_]+?)/([a-zA-Z0-9\?]+)\.html$ /$1/$2/$3\?do=$4
RewriteRule ^/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)\.html$ /$1/$2/$3/$4.asp
RewriteRule ^/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)/([a-zA-Z0-9\_]+?)/([a-zA-Z0-9\_]+?)\.html$ /$1/$2/$3/$4.asp
RewriteRule ^/([a-zA-Z0-9\.]+?)\-([0-9]+)\-([0-9]+?).html$ /$1\.asp\?ipagesize\=$2\&Page=$3
#RewriteRule ^/([a-z]+)\-([0-9]+)\-([0-9]+)\.html$ /$1\.asp\?ipagesize\=$2\&Page=$3
RewriteRule ^/([a-zA-Z]+?)/([a-zA-Z]+?)/([a-zA-Z0-9\_]+?)/([a-zA-Z]+?)\.html$ /search/order/$3/$4\.asp
修改你网站的导航链接为伪静态地址就ok了。
RewriteRule ^/([a-zA-Z0-9\_]+?)\.html$ /$1\.asp
RewriteRule ^/news\/([0-9]+?)\.html$ /newslist\.asp\?lmtype\=$1
RewriteRule ^/new\/([0-9]+?)\.html$ /info\.asp\?aboutid\=$1
RewriteRule ^/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)\.html$ /$1/$2\.asp
#RewriteRule ^/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)/([a-zA-Z0-9\_]+?)/([a-zA-Z0-9\?]+)\.html$ /$1/$2/$3\?do=$4
RewriteRule ^/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)\.html$ /$1/$2/$3/$4.asp
RewriteRule ^/([a-zA-Z0-9]+?)/([a-zA-Z0-9]+?)/([a-zA-Z0-9\_]+?)/([a-zA-Z0-9\_]+?)\.html$ /$1/$2/$3/$4.asp
RewriteRule ^/([a-zA-Z0-9\.]+?)\-([0-9]+)\-([0-9]+?).html$ /$1\.asp\?ipagesize\=$2\&Page=$3
#RewriteRule ^/([a-z]+)\-([0-9]+)\-([0-9]+)\.html$ /$1\.asp\?ipagesize\=$2\&Page=$3
RewriteRule ^/([a-zA-Z]+?)/([a-zA-Z]+?)/([a-zA-Z0-9\_]+?)/([a-zA-Z]+?)\.html$ /search/order/$3/$4\.asp
修改你网站的导航链接为伪静态地址就ok了。
需要注意如下几个问题:
1. 将 Rewrite 拷贝到 c:\Rewrite(可以安装在任何目录)
2. 在IIS的Isapi上添加这个筛选器, 筛选器名称Rewrite,可执行文件选择 Rewrite.dll
3. 重新启动IIS
4. httpd.ini 是配置文件,如果您了解Rewrite 规则,可以直接对其进行编辑
5.Rewrite.dll必须要放在c:\windows和c:\windows\system32目录下边
6.要给c:\rewrite目录everyone读取权限
7.如果还是不行就给c:\rewrite目录users组权限和services组读取权限
8.正向规则对空格很严格的,不能随便使用空格
1. 将 Rewrite 拷贝到 c:\Rewrite(可以安装在任何目录)
2. 在IIS的Isapi上添加这个筛选器, 筛选器名称Rewrite,可执行文件选择 Rewrite.dll
3. 重新启动IIS
4. httpd.ini 是配置文件,如果您了解Rewrite 规则,可以直接对其进行编辑
5.Rewrite.dll必须要放在c:\windows和c:\windows\system32目录下边
6.要给c:\rewrite目录everyone读取权限
7.如果还是不行就给c:\rewrite目录users组权限和services组读取权限
8.正向规则对空格很严格的,不能随便使用空格