通过web.config在Win环境实现wordpress伪静态
-
之前讲过一篇通过404在Win环境实现wordpress伪静态的文章,在这里我要提出通过404在Win环境实现wordpress伪静态的缺点是不能实现完美的翻页功能,所以我今天补充一下通过web.config在Win环境实现wordpress伪静态的方法,但是针对web.config的设置只在IIS7以后的版本才有效。以下就是设置方法:
在网站根目录或者服务器根目录下的web.config文件中加入以下内容
<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<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”/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
没有web.config这个文件的话可以新建一个记事本,把以上代码粘贴进去,然后上传到你的服务器或者网站根目录,我再强调一下这种方法只在IIS7以后的版本才有效。
本文固定链接: http://www.kerry86.com/479.html | 合肥SEO
- 话题 ‘通过web.config在Win环境实现wordpress伪静态’不再接受新回复。