Typecho伪静态.htaccess设置方法:根目录、二级目录


如果你的Typecho是安装在根目录,在根目录新建一个.htaccess文件,将以下代码放入保存:

<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是安装在二级目录(演示:ty),在二级目录新建一个.htaccess文件,将以下代码放入保存(只需要将 RewriteBase / 修改为 RewriteBase /ty 即可):

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

抱歉,评论已关闭