wordpress新手站长在设置固定链接的时候可能会发现这样的情况,固定链接里全部带了一个index.php,而正常情况下是没有的 如图:wordpress固定链接中带index.php 新手们可能在百度上找了很久,而且用了各种方法,如.htaccess、404.php、httpd.ini等等方法,都不行,为什么呢?因为网上水贴太多,教程太敷衍。不过也有可能是不适合你的问题。 不过以下是正解无误的,有需要的同学可以参考下 如果你试过网上的很多方法,那么上传、改名这些步骤就不详细说了,你可能已经操作过N遍了。 新建一个httpd.ini文件,将以下内容添加上。

[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files# from accessing through HTTP
# Rules to ensure that normal content gets through
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /wp-(.*) /wp-$1 [L]
# For normal wordpress content, via index.php
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]

上传好后,手动修改下固定链接,再打开一篇文章 会发现没有了index.php