0
(0)

使用wordpress搭建网站最佳搭配主机是linux或unix主机,如果你不慎选择了windows主机,你会发现即使做好了URL伪静态也会在链接中多出一个index.php的东东,很烦人也对优化不太好,以下是去除链接中index.php的方法:

首先桌面新建一个txt文本,然后复制以下代码至txt文件中:

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

然后保存文本文件为httpd.ini文件;
最后把httpd.ini文件上传至空间根目录
OK,这个时候再次刷新网站首页检查那个烦人的index.php是不是神奇的消失了呢。

声明:本站分享的WordPress主题/插件均遵循 GPLv2 许可协议(免费开源),相关介绍资料仅供学习参考,实际版本可能会因版本迭代或开发者调整而产生变化,如程序中涉及有第三方原创图像、设计模板、远程服务等内容,应获得作者授权后方可使用。本站不提供该程序/软件的产品授权与技术服务,亦不收取相关费用。