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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[教程] X2在IIS7.5 Rewrite伪静态规则方法(三)

[复制链接]
Peker 发表于 2011-6-13 12:49:37 | 显示全部楼层 |阅读模式
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3. <system.webServer>


  4. <rewrite>
  5. <rules>
  6. <rule name="portal_topic">
  7. <match url="^(.*/)*topic-(.+).html\?*(.*)$" />
  8. <action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" />
  9. </rule>
  10. <rule name="portal_article">
  11. <match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)$" />
  12. <action type="Rewrite" url="{R:1}/portal.php\?mod=view&aid={R:2}&page={R:3}&{R:4}" />
  13. </rule>
  14. <rule name="forum_forumdisplay">
  15. <match url="^(.*/)*forum-(\w+)-([0-9]+).html\?*(.*)$" />
  16. <action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}" />
  17. </rule>
  18. <rule name="forum_viewthread">
  19. <match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" />
  20. <action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&tid={R:2}&extra=page%3D{R:4}&page={R:3}&{R:5}" />
  21. </rule>
  22. <rule name="group_group">
  23. <match url="^(.*/)*group-([0-9]+)-([0-9]+).html\?*(.*)$" />
  24. <action type="Rewrite" url="{R:1}/forum.php\?mod=group&fid={R:2}&page={R:3}&{R:4}" />
  25. </rule>
  26. <rule name="home_space">
  27. <match url="^(.*/)*space-(username|uid)-(.+).html\?*(.*)$" />
  28. <action type="Rewrite" url="{R:1}/home.php\?mod=space&{R:2}={R:3}&{R:4}" />
  29. </rule>
  30. <rule name="home_blog">
  31. <match url="^(.*/)*blog-([0-9]+)-([0-9]+).html\?*(.*)$" />
  32. <action type="Rewrite" url="{R:1}/home.php\?mod=space&uid={R:2}&do=blog&id={R:3}&{R:4}" />
  33. </rule>
  34. <rule name="forum_archiver">
  35. <match url="^(.*/)*(fid|tid)-([0-9]+).html\?*(.*)$" />
  36. <action type="Rewrite" url="{R:1}/index.php\?action={R:2}&value={R:3}&{R:4}" />
  37. </rule>
  38. </rules>
  39. </rewrite>

  40. <defaultDocument>
  41. <files>
  42. <clear />
  43. <add value="index.asp" />
  44. <add value="dufault.html" />
  45. <add value="Default.htm" />
  46. <add value="Default.asp" />
  47. <add value="index.htm" />
  48. <add value="index.html" />
  49. <add value="iisstart.htm" />
  50. <add value="default.aspx" />
  51. <add value="index.php" />
  52. </files>
  53. </defaultDocument>
  54. </system.webServer>
  55. </configuration>
复制代码
方法很简单。直接修改论坛根目录下的web.config文件



web.config文件覆盖就行了:


Linux0911 发表于 2011-6-19 21:01:07 | 显示全部楼层
本帖最后由 Linux0911 于 2011-6-19 21:01 编辑

No use.
I'm using FastCGI mode, any idea?

Server 2k8 R2 IIS 7.5/PHP 5.3.6(FastCGI)/MySQL 5.5.13
回复

使用道具 举报

ziyeboy 发表于 2011-6-22 14:19:32 | 显示全部楼层
唉 。。。。。。。。。。。。

我解决之后才看到。。。。。。。。。。。。
回复

使用道具 举报

wqslh 发表于 2011-7-12 22:11:40 | 显示全部楼层
回复

使用道具 举报

liqu12511 发表于 2011-7-13 13:59:58 | 显示全部楼层
好帖
收藏了
回复

使用道具 举报

hsumai 发表于 2011-9-4 03:40:05 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

千寻 发表于 2011-9-7 23:45:06 | 显示全部楼层
眼泪花花的啊,能看到技术贴不容易啊
回复

使用道具 举报

残阳剑客 发表于 2011-9-9 09:26:22 | 显示全部楼层
直接修改论坛根目录下的web.config文件

我记得我是把文件保存到haccess格式的文件,然后放到论坛根目录下的。

不知道两种方法有何不同,望楼主指教哦。
回复

使用道具 举报

zg-chen 发表于 2011-9-9 15:38:50 | 显示全部楼层
我的也实现了。。。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-27 00:43 , Processed in 0.164535 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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