Warning: Illegal string offset 'top' in /www/wwwroot/hellyhua.com/wp-content/themes/Snape/single.php on line 45

Wordpress使用WIN主机来建站对伪静态使用比较麻烦,在访问网站的时候会在网址后面出现index.php/index.php,所以对这个链接中的index.php问题进行了研究,做出如下的方案。

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

  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文件上传到WP程序所在的目录也就是与index.php在同一个目录内。

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

刷新博客首页,打开文章链接看看链接地址中的index.php是不是消失了。


Warning: Illegal string offset 'footer' in /www/wwwroot/hellyhua.com/wp-content/themes/Snape/single.php on line 49