最近在二级目录装了一个typecho,设置永久链接的伪静态时,提示“重写功能检测失败,请检查你的服务器设置”,于是求助于万能的网络后找到了答案。我用的是虚拟主机,解决方法记录如下,亲测有效。
在你的二级目录(blog 文件夹)里面新建【.htaccess】,写入下面代码:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
这样一台服务器可以装多个typecho,我以前也是这么用的