源码空间设计梦想室www.ymhost.cn香港空间|高防空间|免备空间|ASP空间|PHP空间|NET空间|HTML空间

您的当前位置:网站首页 » 本站公告 » 正文—产品服务相关-

知识:IIS7的wordpress伪静态设置

来源:本站 发表:2018-2-7 点击:711

部分使用香港虚拟主机的用户在win空间下不懂得如何配置伪静态,win空间采用iis7+版本,通过web.config配置文件进行伪静态设置,而且php版本也是通过该文件进行配置。

 
您需要将php版本设置为5.4并且把下面的伪静态脚本写入web.config文件中,下面是rewrite代码

 
<rewrite>
      <rules>
                <rule name="Main Rule" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <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 logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
       </rules>
    </rewrite>