Typecho伪静态如何设置 Typecho伪静态规则

2025-05-25 0 27

伪静态可以增加搜索引擎的友好度,提高网站内容收录量,所以我们在使用Typecho程序搭建博客网站后,要设置伪静态,那么Typecho伪静态如何设置?不同Web服务器下Typecho伪静态规则是什么?下面一起来了解下。

一、不同环境下Typecho伪静态规则

1、Linux Apache 环境(Nginx):

location / {

index index.html index.php;

if (-f $request_filename/index.html) {

rewrite (.*) $1/index.html break;

}

if (-f $request_filename/index.php) {

rewrite (.*) $1/index.php;

}

if (!-f $request_filename) {

rewrite (.*) /index.php;

}

}

2、Nginx配置

server {

listen 80;

server_name yourdomain.com;

root /home/yourdomain/www/;

index index.html index.htm index.php;

if (!-e $request_filename) {

rewrite ^(.*)$ /index.php$1 last;

}

location ~ .*\\.php(\\/.*)*$ {

include fastcgi.conf;

fastcgi_pass 127.0.0.1:9000;

}

access_log logs/yourdomain.log combined;

}

3、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>

4、宝塔面板中配置Typecho伪静态

如果我们用的是宝塔面板管理服务器,那么在Typecho开启伪静态操作就非常简单,直接选择对应的网站,在设置里面单击“伪静态”,下拉菜单选中Typecho即可。

Typecho伪静态如何设置 Typecho伪静态规则

二、后台配置Typecho伪静态

通过上述设置后,接下来登录到Typecho博客网站后台,点击设置,选择永久链接,配置伪静态。

Typecho伪静态如何设置 Typecho伪静态规则

如果出现红色的框提示,如下图所示,勾选后再提交即可。

Typecho伪静态如何设置 Typecho伪静态规则

以上是关于Typecho伪静态设置规则及方法的介绍,希望能对大家有所帮助。

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

快网idc优惠网 建站教程 Typecho伪静态如何设置 Typecho伪静态规则 https://www.kuaiidc.com/15009.html

相关文章

发表评论
暂无评论