136 字
1 分钟

Typecho 链接去 index.php

2025-05-29
无标签
浏览量 加载中...

Typecho 链接去 index.php#

刚用 Typecho 的用户肯定遇到过在打开页面地址结果在主域名后多了个 index.php 的问题吧,那么下面就来教你怎么解决这个问题吧。

Typecho 后台开启伪静态#

设置 → 永久链接设置,选择启用地址重写功能,并选择你喜好的文章路径 (url 形式) 。

配置服务器的 rewrite 规则#

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>

Nginx:

server {
...
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
...
}
Typecho 链接去 index.php
https://www.satxm.top/posts/typecho-index/
作者
Satxm
发布于
2025-05-29
许可协议
CC BY-NC-SA 4.0
最后更新于 2025-05-29,距今已过 197 天

部分内容可能已过时

评论区

目录