tx

彭鸿

寒江孤影,江湖故人!
238,906
typecho完美实现伪静态,去掉index.php typecho完美实现伪静态,去掉index.php

之前博客开启伪静态后,重起浏览器发现就会失效,网址中仍带有index.php。于是百度和论坛上发贴都没找到好方法。试过将.htacess 权限也设置为 777,也没用。将其代码

< IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase / 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php/$1 [L] 
< /IfModule>

修改为:

< IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
< /IfModule>

仍不见效。

后来想到重新安装typecho,去备份mysql数据的时候,看了下typecho_options的表,将rewrite的值1改为0.立马解决了问题。记录一下,方便有同样问题的人解决。

noindexphp.jpg

仅有 1 条评论
user 编辑评论信息
插入图片

隐私评论
  1. @
    2020年03月23日
    Android N · Chrome 64

    找了半天了,万分感谢。谢谢!