昨天晚上在iis环境下搭建wp使用的时候碰到该问题,之前一直处于Linux环境下,iis下就闲的蛋疼了。据常理,固定链接通常需要mod_rewrite,可惜winserver不支持,在web.config中增加此规则吧!根据需求增加。对号入座~ 杯具,GD的ns又无法使用了~刚刚看到@奚少的留言才发现,最近一直没注意过是否可以用www.gongzi.me访问! 换了ns,看看待会儿是否可以。破事儿真多~

< ?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system .webServer>
    <rewrite>
      <rules><rule name="Main Rule" stopProcessing="true"><match url=".*"/><conditions logicalGrouping="MatchAll"><add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/><add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/></conditions><action type="Rewrite" url="index.php/{R:0}"/>
         </rule>rule name="wordpress" patternSyntax="Wildcard">
	<match url="*"/>
	<conditions>
		<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
		<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
	</conditions>
		<action type="Rewrite" url="index.php"/>
	</rules>
    </rewrite>
  </system>
</configuration>

还有个问题,wp在iis上貌似无法上传图片,使用浏览器上传方式可以。flash的不行!

2>IIS7.5 下Discuzx2伪静态规则:

< ?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system .webServer>
<httperrors>
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="http://www.ght.me/404.htm" responseMode="Redirect" />
        </httperrors>

<rewrite>
        <rules>
        <rule name="portal_topic">
              <match url="^(.*/)*topic-(.+).html?*(.*)$" />
              <action type="Rewrite" url="{R:1}/portal.php?mod=topic&topic={R:2}&{R:3}" />
         </rule>
         <rule name="portal_article">
              <match url="^(.*/)*article-([0-9]+)-([0-9]+).html?*(.*)$" />
             <action type="Rewrite" url="{R:1}/portal.php?mod=view&aid={R:2}&page={R:3}&{R:4}" />
          </rule>
             <rule name="forum_forumdisplay">
               <match url="^(.*/)*forum-(w+)-([0-9]+).html?*(.*)$" />
                <action type="Rewrite" url="{R:1}/forum.php?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}" />
           </rule>
             <rule name="forum_viewthread">
                <match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html?*(.*)$" />
                <action type="Rewrite" url="{R:1}/forum.php?mod=viewthread&tid={R:2}&extra=page%3D{R:4}&page={R:3}&{R:5}" />
            </rule>
             <rule name="group_group">
                <match url="^(.*/)*group-([0-9]+)-([0-9]+).html?*(.*)$" />
                <action type="Rewrite" url="{R:1}/forum.php?mod=group&fid={R:2}&page={R:3}&{R:4}" />
           </rule>
             <rule name="home_space">
                <match url="^(.*/)*space-(username|uid)-(.+).html?*(.*)$" />
                <action type="Rewrite" url="{R:1}/home.php?mod=space&{R:2}={R:3}&{R:4}" />
            </rule>
             <rule name="home_blog">
                <match url="^(.*/)*blog-([0-9]+)-([0-9]+).html?*(.*)$" />
                <action type="Rewrite" url="{R:1}/home.php?mod=space&uid={R:2}&do=blog&id={R:3}&{R:4}" />
             </rule>
              <rule name="forum_archiver">
                 <match url="^(.*/)*(fid|tid)-([0-9]+).html?*(.*)$" />
                 <action type="Rewrite" url="{R:1}/index.php?action={R:2}&value={R:3}&{R:4}" />
                </rule>
        </rules>
</rewrite>

        <defaultdocument>
            <files>
                <clear />
                <add value="index.asp" />
                <add value="dufault.html" />
                <add value="Default.htm" />
                <add value="Default.asp" />
                <add value="index.htm" />
                <add value="index.html" />
                <add value="iisstart.htm" />
                <add value="default.aspx" />
                <add value="index.php" />
            </files>
        </defaultdocument>
    </system>
</configuration>

保存为web.config

仅作备忘~