Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已解决] 求一个iis7下面的url rewrite文件web.config

[复制链接]
colo88 发表于 2010-3-25 22:44:35 | 显示全部楼层 |阅读模式
本帖最后由 colo88 于 2010-3-25 23:09 编辑

网上搜了半天,只找到discuz的web.config文件

想自己写一个却老是出错,请高手帮忙看看错在哪里。。。
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3.     <system.webServer>
  4.         <rewrite>
  5.             <rules>
  6.                 <rule name="Imported Rule 1" stopProcessing="true">
  7.                     <match url="^home/(space|network)-(.+)\.html$" ignoreCase="false" />
  8.                     <action type="Rewrite" url="/home/{R:1}\.php\?rewrite={R:2}" appendQueryString="false" />
  9.                 </rule>
  10.                 <rule name="Imported Rule 2" stopProcessing="true">
  11.                     <match url="^home/(space|network)\.html$" ignoreCase="false" />
  12.                     <action type="Rewrite" url="/home/{R:1}\.php" />
  13.                 </rule>
  14.                 <rule name="Imported Rule 3" stopProcessing="true">
  15.                     <match url="^home/([0-9]+)$" ignoreCase="false" />
  16.                     <action type="Rewrite" url="/home/space\.php\?uid={R:1}" appendQueryString="false" />
  17.                 </rule>
  18.             </rules>
  19.         </rewrite>
  20.     </system.webServer>
  21. </configuration>
复制代码
ae6089 发表于 2010-3-26 10:06:59 | 显示全部楼层
你安装 ISAPI_Rewrite 了吗?

然后在IIS筛选器添加ISAPI_Rewrite.dll  重启IIS即可
回复

使用道具 举报

 楼主| colo88 发表于 2010-3-26 10:27:11 | 显示全部楼层
回复 2# ae6089


    iis7和以前的iis6不一样,安装了微软的url rewrite模块以后,只用在网站目录下放一个web.config就行了,iis7一般都用fastcgi,不再使用ISAPI了
回复

使用道具 举报

 楼主| colo88 发表于 2010-3-26 13:16:32 | 显示全部楼层
自己顶一下,希望知道的高手能指点一下,不胜感激!
回复

使用道具 举报

 楼主| colo88 发表于 2010-3-26 13:40:59 | 显示全部楼层
自己瞎掰搞定了。。。iis7的rewrite模块导入的规则还不能直接拿来用,需要修改一下才行。。。
回复

使用道具 举报

sannly 发表于 2010-4-18 19:19:24 | 显示全部楼层
自己瞎掰搞定了。。。iis7的rewrite模块导入的规则还不能直接拿来用,需要修改一下才行。。。
colo88 发表于 2010-3-26 13:40



    如何修改啊,我也碰到此问题
回复

使用道具 举报

chinaheiyu 发表于 2010-5-20 12:21:22 | 显示全部楼层
我也遇到问题。。
回复

使用道具 举报

和谐论坛 发表于 2010-6-8 18:15:34 | 显示全部楼层
怎么解决的
回复

使用道具 举报

shineshi 发表于 2010-7-23 00:54:09 | 显示全部楼层
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>

  3.     <system.webServer>
  4.         <rewrite>
  5.             <rules>
  6.                 <rule name="topic">
  7.                     <match url="^topic-(.+)\.html$" />
  8.                     <action type="Rewrite" url="portal.php?mod=topic&amp;topic={R:1}" />
  9.                 </rule>
  10.                 <rule name="article">
  11.                     <match url="^article-([0-9]+)\.html$" />
  12.                     <action type="Rewrite" url="portal.php?mod=view&amp;aid={R:1}" />
  13.                 </rule>
  14.                 <rule name="forum">
  15.                     <match url="^forum-([0-9]+)-([0-9]+)\.html$" ignoreCase="false" />
  16.                     <action type="Rewrite" url="forum.php?mod=forumdisplay&amp;fid={R:1}&amp;page={R:2}" appendQueryString="false" />
  17.                 </rule>
  18.                 <rule name="thread">
  19.                     <match url="^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" />
  20.                     <action type="Rewrite" url="forum.php?mod=viewthread&amp;tid={R:1}&amp;extra=page={R:3}&amp;page={R:2}" />
  21.                 </rule>
  22.                 <rule name="group">
  23.                     <match url="^group-([0-9]+)-([0-9]+)\.html$" />
  24.                     <action type="Rewrite" url="forum.php?mod=group&amp;fid={R:1}&amp;page={R:2}" />
  25.                 </rule>
  26.                 <rule name="space">
  27.                     <match url="^space-(username|uid)-(.+)\.html$" />
  28.                     <action type="Rewrite" url="home.php?mod=space&amp;{R:1}={R:2}" />
  29.                 </rule>
  30.                 <rule name="Xrewrite">
  31.                     <match url="^([a-z]+)-(.+)\.html$" />
  32.                     <action type="Rewrite" url="{R:1}.php?rewrite={R:2}" />
  33.                 </rule>
  34.             </rules>
  35.         </rewrite>

  36.   </system.webServer>

  37. </configuration>
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-10-7 11:27 , Processed in 0.166543 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表