xmpcw 发表于 2018-12-1 15:02:37

WIN2008系统的IIS7.0配置REWRITE伪静态环境

<span style="color: rgb(85, 85, 85); font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-indent: 24px; background-color: rgb(236, 217, 170);">WIN2008作为服务器,上前已经是非常普遍了, 对于用惯了WIN2003下IIS6.0的人来说, 要在IIS7.0下设置IIS REWRITE这个组件,似乎没有那么顺手IISREWRITE的组件这里也用不了。 首先要准备IIS7.0的REWRITE组件。这个可以上IIS的官网上下载 下载地址:http://www.iis.net/download/URLRewrite 根据需要,点击右侧的下载链接(我的系统是64位的,就下载x64的) 下载安装, 为了保证IIS的顺利运行,最后重启下服务器(非重启IIS服务器)。再进入IIS管理会看到这样一个图标,就是URL REWRITE WIN2008系统的IIS7.0配置REWRITE伪静态环境(转) - 天行健 - 上善若水 然后进入需要设置伪静态的站点, 双击这个图标, 看就会看到下面的图片 WIN2008系统的IIS7.0配置REWRITE伪静态环境(转) - 天行健 - 上善若水 导入相应的伪静态的规则就行了 WIN2008系统的IIS7.0配置REWRITE伪静态环境(转) - 天行健 - 上善若水 WIN2008系统的IIS7.0配置REWRITE伪静态环境(转) - 天行健 - 上善若水 WIN2008系统的IIS7.0配置REWRITE伪静态环境(转) - 天行健 - 上善若水 THINKPHP的.htaccess是:&nbsp;</span><ifmodule mod_rewrite.c="" style="line-height: 18px; color: rgb(85, 85, 85); font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-indent: 24px; background-color: rgb(236, 217, 170);">RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 &nbsp;</ifmodule><span style="color: rgb(85, 85, 85); font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-indent: 24px; background-color: rgb(236, 217, 170);">如果还不行的就,就要修改站点根目录的Web.Config这个文件了。 提供一下范例给大家:&nbsp;</span><configuration style="line-height: 18px; color: rgb(85, 85, 85); font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-indent: 24px; background-color: rgb(236, 217, 170);"><system.webserver style="line-height: 18px;"><rewrite style="line-height: 18px;"><rules style="line-height: 18px;"><rule name="Rule Names" stopprocessing="true" style="line-height: 18px;"><match url="^index.html" style="line-height: 18px;"><action type="Rewrite" url="/index.php" style="line-height: 18px;"></action></match></rule><rule name="Imported rule=" rule"="" 2"="" stopprocessing="true" style="line-height: 18px;"><match url="^article/(.*).html" style="line-height: 18px;"><action type="Rewrite" url="/index.php?article_id={R:1}" style="line-height: 18px;"></action></match></rule></rules></rewrite></system.webserver></configuration><span style="color: rgb(85, 85, 85); font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-indent: 24px; background-color: rgb(236, 217, 170);">至此伪静态配置完成</span><p></p>
页: [1]
查看完整版本: WIN2008系统的IIS7.0配置REWRITE伪静态环境