码迷,mamicode.com
首页 > 其他好文 > 详细

iis wordpress 404错误 伪静态rewrite

时间:2018-09-12 20:03:45      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:request   false   als   com   ati   query   php   code   name   

https://jingyan.baidu.com/article/cbf0e500ebec582eaa2893d2.html

在wordpress根目录,将以下内容保存为 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>

 

iis wordpress 404错误 伪静态rewrite

标签:request   false   als   com   ati   query   php   code   name   

原文地址:https://www.cnblogs.com/lola/p/9636162.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!