IIS 7配置启用URL Rewrite重写
IIS 7配置启用URL Rewrite重写
Windows7或者Windows2008环境下配置IIS 7支持URL Rewrite重写
默认情况下IIS 7没有支持URL Rewrite,要使用URL重写,首先要安装URL Rewrite组建,官方地址如下:
http://www.iis.net/download/URLRewrite
WEB平台自动安装,安装完成后在网站根目录简历web.config就可以实现URL重写了,下面是一个codeigniter的重写规则:
- <?xml version="1.0" encoding="UTF-8"?>
- <configuration>
- <system.webServer>
- <rewrite>
- <rules>
- <rule name="Rewrite to index.php">
- <match url="index.php|robots.txt|images|test.php" />
- <action type="None" />
- </rule>
- <rule name="Rewrite CI Index">
- <match url=".*" />
- <conditions>
- <add input="{REQUEST_FILENAME}" pattern="css|js|jpg|jpeg|png|gif|ico|htm|html" negate="true" />
- </conditions>
- <action type="Rewrite" url="index.php/{R:0}" />
- </rule>
- </rules>
- </rewrite>
- </system.webServer>
- </configuration>
目录 返回
首页