https URL重写将重写为域根目录,不保留url结构WordPress网站

时间:2018-08-23 23:43:39

标签: php wordpress iis web-config

如果链接http://EXAMPLE.com/services会路由到https://EXAMPLE.com,而忽略/ services。我们该如何纠正呢?

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="font/x-woff" />
</staticContent>  
<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>
<rule name="Redirect to HTTPS" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" />
<add input="{HTTP_HOST}" pattern="^www.EXAMPLE.com$" />
</conditions>
<action type="Redirect" url="https://EXAMPLE.com/{R:0}" redirectType="Permanent" />
</rule></rules>
</rewrite>
</system.webServer>
</configuration>

0 个答案:

没有答案