云主机 Windows2008服务器IIS7/IIS7.5配置wordpress伪静态web.config
问题网上关于IIS6的伪静态设置文章比较多,但是iis7以上版本的比较少,这里介绍给运行在IIS7以上版本上的wordpress配置伪静态规则
虽然百家云只提供专业PHP虚拟主机,不提供windows平台的虚拟主机,但是考虑到很多百家云的云主机用户会用到IIS,所以特地做了此篇教程,希望可以帮到您!
解决办法
1、IIS7以上版本的规则文件名web.config,首选新建一个文件名为web.config,用记事本打开,复制以下代码,保存:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="category">
<match url="category/?(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="/index.php?category_name={R:1}" appendQueryString="false" logRewrittenUrl="false" />
</rule>
<rule name="tags">
<match url="tag/?(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="index.php?tag={R:1}" />
</rule>
<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>
</system.webServer>
</configuration>
2、把该web.config文件放到wordpress网站根目录,然后重启该网站即可。
百家云,好用不贵!
页:
[1]