Z-blog怎麼通過修改伪静態配置文件,強制網站使用https访問

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://zh-tw.finchui.com/zblog-course/53.html

网友評論

猜你喜歡

熱門商品
熱門文章
熱門標簽
相關標簽
FinchUI商店版 香港特惠專區

分享

復制链接

星岚工作室添加好友

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