web.config无法使用子文件夹中的WordPress永久链接

web.config无法使用子文件夹中的WordPress永久链接,第1张

概述我在根文件夹中的IIS服务器上安装了WP.这适用于非常永久链接. 在/ development中还有另一个wordpress安装,它使用以下web.config <?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer> <rewrite> <rules> <ru 我在根文件夹中的IIS服务器上安装了WP.这适用于非常永久链接.

在/ development中还有另一个wordpress安装,它使用以下web.config

<?xml version="1.0" enCoding="UTF-8"?><configuration>  <system.webServer>    <rewrite>      <rules>            <rule name="wordpress1" 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>    <staticContent>      <clIEntCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00"/>      <remove fileExtension=".woff"/>      <remove fileExtension=".woff2"/>      <mimeMap fileExtension=".woff" mimeType="application/x-Font-woff"/>      <mimeMap fileExtension=".woff2" mimeType="application/Font-woff2"/>    </staticContent>  </system.webServer></configuration>

但是,在子文件夹中,相当固定链接无法在此站点上运行

但是,当选择了普通永久链接时,主页可以使用此子文件夹

有什么想法吗?

解决方法 pee2pee说的答案是将该行放在代码中.

<remove name="YourRulename"/>

要执行此 *** 作,您必须首先查看root的web.config文件并查找此行.

<rule name = "YourRulename" patternSyntax = "Wildcard">

然后复制目录或子文件夹的web.config文件中的行,将“YourRulename”更改为您在第一个标记上方的根目录的web.config文件中找到的名称.

然后,您的子文件夹的web.config文件应该是这样的

<?xml version="1.0" enCoding="UTF-8"?><configuration>  <system.webServer>    <rewrite>      <rules>            <remove name="YourRulename"/>            <rule name="YourSubFolderRulename" 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无法使用子文件夹中的WordPress永久链接全部内容,希望文章能够帮你解决web.config无法使用子文件夹中的WordPress永久链接所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1083352.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存