从iis7中的wordpress URL中删除index.php

编程入门 行业动态 更新时间:2024-10-24 22:23:41
本文介绍了从iis7中的wordpress URL中删除index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想从url中删除index.php,我正在使用wordpress和iis7。 我该怎么办

I want to remove index.php from url , i am using wordpress and iis7 . how can i do this

推荐答案

使用这个web.config

Use this 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>

然后在永久链接页面中,设置自定义结构并给出值 / %postname%/

Then in permalinks page, set "Custom Structure" and give the value /%postname%/

更多推荐

从iis7中的wordpress URL中删除index.php

本文发布于:2023-11-01 11:33:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549230.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:wordpress   URL   php   index

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!