wordpress - 如何使用非拉丁 url 在 iis 上为 wordpress 编写 web.

我在 iis 服务器上使用 wordpress wirh 永久链接结构 (/%year%/%monthnum%/%day%/%postname%/)。

问题在于非拉丁字符,如马拉雅拉姆语。

我写的web.config如下,

<?xml version="1.0" encoding="utf-8"?>
<configuration>

<system.web>
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="" relaxedUrlToFileSystemMapping="true" AllowRestrictedChars="1" UrlSegmentMaxLength="2048" />
<pages validateRequest="false" />

</system.web> 

<system.webServer>

<security>
<requestFiltering allowDoubleEscaping="true" />
</security>

<rewrite>
<rules>
<rule name="WordPress 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?page={R:0}" />
</rule>
</rules>
</rewrite>

</system.webServer>
</configuration>

帖子页面转到日期存档。如何解决这个问题?

最佳答案

只需将下面的代码添加到您网站根目录下的 index.php 文件中:

    if (isset($_SERVER['UNENCODED_URL'])) {
    $_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];
}

您的 web.config 需要像这样:

 <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
            <rule name="WordPress: http://yoursite" 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>

关于wordpress - 如何使用非拉丁 url 在 iis 上为 wordpress 编写 web.config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24280940/

相关文章:

sorting - thenComparing 与 thenComparingInt 的性能 - 使

hibernate - 在 JPA 中同时映射键和对象

spring - 错误 : "Connection refused: connect. 验证连接属性

json - 在 JSON-RPC 连接上读取多个 JSON 对象

r - 按第一列对矩阵列表进行排序

design-patterns - 策略接口(interface)中的策略模式和方法数量

oracle - Mysql Workbench 将 sql 导出到 Oracle 11

c# - C# 对象中 [key] 的用途是什么?

ports - 代理服务器的推荐端口

ruby-on-rails - 不知道如何构建任务 - cucumber