Wordpress url重写在iis7上不起作用
我有一个Wordpress网站在IIS7上运行 我遇到了一个大问题,因为除了主页之外,我所有的url都包含index.php 我的主页:www.mywebsite.com 其他:www.mywebsite.com/index.php/post1、www.mywebsite.com/index.php/post2等等 我想使用IIS7的url重写模式。我的网络主机告诉我重写模块被激活了 我不知道在web.config文件中写什么。我试过:Wordpress url重写在iis7上不起作用,wordpress,iis-7,url-rewriting,Wordpress,Iis 7,Url Rewriting,我有一个Wordpress网站在IIS7上运行 我遇到了一个大问题,因为除了主页之外,我所有的url都包含index.php 我的主页:www.mywebsite.com 其他:www.mywebsite.com/index.php/post1、www.mywebsite.com/index.php/post2等等 我想使用IIS7的url重写模式。我的网络主机告诉我重写模块被激活了 我不知道在web.config文件中写什么。我试过: <?xml version="1.0" encodi
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<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>
</rules>
</rewrite>
</system.webServer>
</configuration>
我的url没有改变
这是:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Supprimer index.php">
<match url="^index.php/([_0-9a-z-]+)/([_0-9a-z-]+)" />
<action type="Rewrite" url="{R:1}/{R:2}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
我也试过:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<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/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
总是不起作用
您能帮我删除url中的index.php吗?
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed"/>
<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/{R:0}"/></rule>
<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>
</rules>
</rewrite>
<defaultDocument>
<files>
<clear/>
<add value="index.php"/>
</files>
</defaultDocument>
</system.webServer>
</configuration>