首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Typecho 伪静态设置

Typecho 伪静态设置

作者头像
用户7146828
发布2021-08-09 15:12:40
3.8K0
发布2021-08-09 15:12:40
举报
文章被收录于专栏:旧云博客旧云博客

前言 Typecho是由国人开发的一套非常优秀的博客系统,代码短小,简单友好,如果我们仅仅是用于文档要求写作的话,那Typecho绝对是互联网写博客的首选程序。 就按我个人来说,我是用宝塔进行管理的,因为对小白友好的一批,安装好Typecho程序后第一步就是去设置伪静态了,不然...你就会翻车 以下会全方面针对不同服务器例如Linux、WEB、二级目录伪静态规则等,资料均来自互联网,有任何问题或者建议或者都欢迎留言,废话不多说直接开始操作。 Linux宝塔设置 以宝塔面板为例子,我们找到 网站-站点设置-伪静态 (如上图)

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

将上方代码复制粘贴到指定位置就可以了

WEB伪静态规则 Apache设置

<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设置

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

IIS设置

[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
RewriteRule /tag/(.*) /index.php?tag=$1
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
RewriteRule /(.*).html /index.php/$1.html [L]
RewriteRule /(.*)/comment /index.php/$1/comment [L]
RewriteRule /category/(.*) /index.php/category/$1 [L]
RewriteRule /page/(.*) /index.php/page/$1 [L]
RewriteRule /search/(.*) /index.php/search/$1 [L]
RewriteRule /feed/(.*) /index.php/feed/$1 [L]
RewriteRule /2(.*) /index.php/2$1 [L]
RewriteRule /action(.*) /index.php/action$1 [L]

二级扩展伪静态 在使用Typecho程序的时候安装在二级目录中,如果正常设置伪静态的时候是在 CONF文件设置即可,但是如果是二级目录的话,那我们就这样设置如下操作

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

这里我们看到foldername没有,我们可以在根目录原来Typecho Nginx伪静态规则.conf文件中加上上面的伪静态,然后将foldername换成我们子目录的文件夹即可。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2021年05月08日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档