很多人可能只以为只要织梦里有index小尾巴,实则不然,其实用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已经消失不见了。