admin管理员组文章数量:1129618
In permalinks(dashboard) section index.php added. e.g.
Current Post Name: .php/sample-post/
Expected Post Name: /
How can i remove index.php?
Note: I am using windows server
In permalinks(dashboard) section index.php added. e.g.
Current Post Name: http://zakatchicago.com/index.php/sample-post/
Expected Post Name: http://zakatchicago.com/sample-post/
How can i remove index.php?
Note: I am using windows server
Share Improve this question edited May 20, 2015 at 12:16 m4n0 1,36410 silver badges22 bronze badges asked May 20, 2015 at 11:05 Kaizur AhmedKaizur Ahmed 811 silver badge4 bronze badges 02 Answers
Reset to default 1As of WP 5.9 (but I am sure way back years and versions) there is no need to add web.config manually.
In case IIS rewrite module is installed (whichi is a prerequisite) when you modify Settings/Permalink, WP automatically emits web.config into the root of your site.
It even writes to the GUI a warning message, to revoke write access from web.config.
If IIS rewrite module is not installed, all of this above is not possible, neither manually, so WP will include the /index.php/
fragment in the path. If you overwrite this setting with a custom permalink setting, then the links will adopt (so will not contain the /index.php/
fragment, but because of lack of rewrite facility IIS will give 404
.
According to the documentation here: http://www.iis.net/learn/extensions/url-rewrite-module/enabling-pretty-permalinks-in-wordpress
I assume you have already selected Post Name
in your permalink structure:
Then include this code in web.config
<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" />
</rule>
</rules>
</rewrite>
本文标签: Remove indexphp in permalink structure on IIS server
版权声明:本文标题:Remove index.php in permalink structure on IIS server 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736749104a1950941.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论