ras*_*111 8 php wordpress iis-7 permalinks url-rewriting
我想从url中删除index.php,我正在使用wordpress和iis7.我怎样才能做到这一点
Bin*_*nod 10
使用此web.config
(web.config是IIS等同于apache webservers中的.htaccess文件.它可以在根文件夹中找到.如果没有,则需要创建一个.)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<!-- Set the default document -->
<files>
<remove value="index.php" />
<add value="index.php" />
</files>
</defaultDocument>
<httpErrors errorMode="Detailed"/>
<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>
Run Code Online (Sandbox Code Playgroud)
然后在永久链接页面中,设置"自定义结构"并给出值 /%postname%/
请注意,需要安装特定于IIS版本的URL重写模块才能使其正常工作(感谢@ Spikolynn的评论如下)
归档时间: |
|
查看次数: |
8085 次 |
最近记录: |