看到很多网站的WordPress的固定连接有一个index.php的,那么可以猜测他/她是使用window主机来的,之前有一些网友也问过我怎么去掉这个,无奈我自己没有使用过,也不知道具体那种方法行得通,只能叫他自己谷歌去,今天在知更鸟那里看到一篇“WordPress去掉win主机链接中index.php”,下面与大家分享如何去掉这个讨人厌的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是不是消失了。
哈哈,不错,待会试试
2011-12-12 10:54@陌凡: 哈哈,最好还是换个Linux主机。
2011-12-13 01:53很好。。学习了
2012-01-02 04:47@哥特复兴: 谢谢支持。欢迎常来。
2012-01-14 12:09收藏了。有时间去试试
2012-01-13 14:37@唯美图片: 哈哈,反正我是不需要为这个烦恼的。
2012-01-14 12:08个人感觉没有必要
2012-02-13 13:14@特特: 嗯,自己喜欢了
2012-05-29 04:31申请友情链接 http://www.boke999.com 蒋毅婚纱摄影博客
2012-02-21 12:16@婚纱摄影: 没看到链接。
2012-02-22 00:57wordpress 还是要用Linux主机好些
2012-03-19 14:01wordpress的技术贴子太多了。
2012-05-10 13:57我都不敢太Diy
这个是关于Windows主机和Linux主机的问题,如果你是Linux的,可以不管的。
2012-05-24 14:27