typecho伪静态并强制301跳转https

文章
20 0

在网站根目录新建.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>
最后更新 2025-01-22 11:32:04
评论 ( 0 )
默认头像
OωO
隐私评论