第一次用Typecho这个程序,摸着石头过河,配置伪静态和SSL证书花了不少时间。
在网站根目录新建.htaccess文件,放入以下代码:
<IfModule mod_rewrite.c>
RewriteEngine On
#伪静态
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L,E=PATH_INFO:$1]
#强制跳转https
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [L,R=301]
</IfModule>
Comments | NOTHING