如何使我司Windows虚拟主机支持静态rewrite功能?
方法:
在购买主机后,请通知我司为您开通urlrewrite功能,然后
是上传httpd.ini(重写配置文件)文件到您的站点根目录下,如我司Windwos主机规定客户站点文件是放置到htdocs目录下的,则把httpd.ini也放置到这个目录下方能生效。httpd.ini文件的格式如下:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O]
# Block external access to the Helper ISAPI Extension
RewriteRule .*\.isrwhlp / [F,I,O]
上面这部分是必须的
RewriteRule ^/[I,i]ndex.html /Index.asp\?hoan1=1 [I]
RewriteRule ^/[R,r]eg.html /Reg.asp [I]
RewriteRule ^/[B,b]ooking.html /Booking.asp\?hoan2=1 [I]
*
*
*
*
这部分是根据您的站点的rewrite要求来写的规则
*
*
*
*
实例
比如,将read.asp?bl_id=123&bu_id=456 伪静态成 /html/123/456.html
可以在规则里面添加一个规则:
RewriteRule ^(.*)/html/([0-9]+)/([0-9]+)\.html$ $1/read\.asp\?bl_id=$2&bu_id=$3
|