Win主机搭建WordPress如何去掉链接中的index.php

发布时间:2021-10-28 08:48

很多人可能只以为只要织梦里有index小尾巴,实则不然,其实用Win主机搭建出来的WordPress也会有index.php小尾巴。

Win主机搭建WordPress如何去掉链接中的index.php

Win主机搭建WordPress如何去掉链接中的index.php

它和织梦去除index.html小尾巴不一样,可以更为简便的轻松去除。很多站长对WP的index.php没什么研究,今天帮一朋友简单的弄了下,还是挺简单的,特地记录方法,以方便日后有需要用到的朋友。

打开记事本,把下面代码粘贴进去:

    [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]

存时保存类型选择“所有文件”,并输入文件名称:httpd.ini

将这个httpd.ini文件上传到WP程序所在的目录也就是与index.php在同一个目录内。

之后进入WP后台修改固定链接,比如:/%category%/%post_id%.html

刷新博客首页,打开文章链接就会发现这时候index.php已经消失不见了。

WordPress纯代码实现文章相关推荐功能 WordPress

WordPress纯代码实现文章相关推荐功能

这两天准备把的相关推荐功能进行了重写,将原来的文章相关推荐功能做了自我感觉非常优秀的改进,相比用其它 WordPress 相关文章推荐的插件来说,我更喜欢自己来折腾,经过这一番的重写 WordPres...