How does Z-blog force websites to use https access by modifying pseudo-static configuration files

image.png

Apache + .htaccess

You can add the following rules to the.htaccess file to enforcehttpsInterview:

RewriteEngine On

RewriteCond %{HTTPS} off

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


The modified.htaccess file is as follows:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

#Add the following rules to enforce 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>

t like1

Link to this article:https://en.finchui.com/zblog-course/53.html

netizens commented

guess you like

hot commodity
popular articles
hot Tags
related tags
FinchUI Store Edition Hong Kong Special Area

share

copy Link

Xinglan Studioadd friends

Working hours: 9:00-22:00
Saturday and Sunday: 14:00-22:00
wechat
Scan the code to add customer service WeChat