凯旋博客

Apache环境下不带www跳转到www/强制https访问/TYPECHO伪静态规则

打开网站根目录下的.htaccess文件,粘贴代码如下:(域名请更换为自己的)

 <IfModule mod_rewrite.c>

RewriteEngine On
RewriteCond %{HTTP_HOST} ^kaixuan.org [NC]
RewriteRule ^(.*)$ https://www.kaixuan.org/$1 [L,R=301]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.kaixuan.org/$1 [R,L]

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L] </IfModule>

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »