【问题标题】:File not found.... Error On Wordpress Permalink change IIS Server找不到文件.... Wordpress 永久链接更改 IIS 服务器时出错
【发布时间】:2017-10-30 12:51:39
【问题描述】:

我一直在使用 IIS windows 服务器开发 WordPress 网站。当我将我的永久链接更改为除帖子 ID 之外的任何内容并尝试访问除主页以外的任何页面时,我收到一个错误

没有指定输入文件。

我正在使用 IIS 服务器来托管我的文件和数据库。我尝试了几种解决方案,包括重置永久链接、配置 php.ini 文件、配置 web.config 文件,但即使链接保持不变,我也没有得到任何结果。我的 web.config 文件在下面

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <directoryBrowse enabled="false" />
    <defaultDocument>
      <files>
        <clear />
        <add value="index.php" />
        <add value="Default.htm" />
        <add value="Default.asp" />
        <add value="index.htm" />
        <add value="Default.aspx" />
      </files>
    </defaultDocument>
    <rewrite>
      <rules>
        <rule name="wordpress" patternSyntax="Wildcard" 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" appendQueryString="true" logRewrittenUrl="false" />
        </rule>
      </rules>
    </rewrite>
        <httpErrors>
            <remove statusCode="500" subStatusCode="-1" />
            <error statusCode="500" prefixLanguageFilePath="" path="/index.php" responseMode="ExecuteURL" />
        </httpErrors>
  </system.webServer>
</configuration>

网站是stage.cirasync.com 主页工作正常,而其他链接出现上述错误。

任何解决此问题的建议。

【问题讨论】:

    标签: php wordpress iis iis-8


    【解决方案1】:

    使用这个配置:

       <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" />
                </rule>
            </rules>
        </rewrite>
    

    希望这会有所帮助

    【讨论】:

    • 删除以上行
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-16
    • 2016-07-19
    • 1970-01-01
    • 2016-12-09
    • 1970-01-01
    • 2017-05-20
    相关资源
    最近更新 更多