typecho伪静态并强制301跳转https

20次阅读
没有评论

在网站根目录新建.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>
正文完
 0
评论(没有评论)
验证码