Z-blog怎么通过修改伪静态配置文件,强制网站使用https访问

finchui81792023-06-26 10:05:53

image.png

Apache + .htaccess

可以在.htaccess文件中添加以下规则来强制https访问:

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


修改过的.htaccess文件如下:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

 # 添加以下规则以强制使用HTTPS

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

不喜欢1

本文链接:https://www.finchui.com/zblog-course/53.html

网友评论

猜你喜欢

热门商品
热门文章
热门标签
相关标签
FinchUI商店版 香港特惠专区

分享

复制链接

星岚工作室添加好友

上班时间:9:00-22:00
周六、周日:14:00-22:00
wechat
扫码添加客服微信