Typecho开启伪静态,去掉index.php教程

Typecho博客初始安装完成后,博客的任何内页面或地址栏都会有 index.php ,都会在域名后加上index.php,很多人都接受不了。

例如,我的博客网址: http://mzhis.com/index.php/archives/3.html

但是,我希望最终的形式是这样: http://mzhis.com/archives/3.html

那么,我们如何做到这样的效果?

配置服务器的Apache伪静态规则

主要是修改 .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>
打赏
评论区
头像
文章目录
您是第 位访问本站的用户 👀

本站已运行:

萌ICP备20255521号