之前没用过typecho,一直用的都是WordPresstypecho nginx 伪静态,但是WordPress实在是很单薄了, 在我这跑的一卡一卡的,于是尝试下比较羽量级的typecho。刚搭建博客的时侯以为很简单,以为直接把项目解压后就完事了。后来发觉需要配置路由typecho nginx 伪静态,配置伪静态的。
配置主要分为两个部份吧:第一是服务器的配置,我用的是nginx,所以要对nginx的配置文件进行更改,第二个是要在后台设置永久链接,在“是否使用地址重画功能”这里选择是。
第一个nginx配置我直接帖配置代码吧,主要是更改nginx.conf底下的内容,
server {
listen 端口号;
server_name 你的域名;
root 你的博客目录;
index index.html index.htm index.php;
charset utf-8;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
#typecho官方给出的伪静态配置
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ .*\.php(\/.*)*$ {
root 你的博客目录;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
#typecho官方给出的伪静态配置
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
$document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
}
配置完以后记得重启一下nginx。
第二个设置是登陆后台,然后在“设置->永久链接->是否使用地址重画功能” 这里钩选启用,设置完以后就可以实现伪静态了。
说真的,比起WordPress来说,typecho响应速率还是挺快的,至于其他的特点边用边发觉吧。