文章目录

Typecho开启伪静态,去除链接中index.php

由 天空David 发布

原博客链接:https://sukiit.com/index.php/github.html
期望链接:https://sukiit.com//github.html

1.Typecho后台设置-永久链接-启用地址重写功能

jt20210912143437.png

2.1 LNMP环境

if (!-e $request_filename) {
    rewrite ^(.*)$ /index.php$1 last;
}

2.2 LAMP环境(没有预设Typecho的伪静态代码)

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

暂无评论

发表评论