57 字
1 分钟
Apache用.htaccess来实现强制https访问
我们可以用Apache的.htaccess来实现http强制跳转到https访问网站。
代码如下:
RewriteEngine OnRewriteCond %{SERVER_PORT} 80RewriteRule ^(.*)$ https://cdn.uu126.cn/$1 [R,L]
如果是在子目录,可以用:
RewriteEngine OnRewriteCond %{SERVER_PORT} 80RewriteCond %{REQUEST_URI} subfolderRewriteRule ^(.*)$ https://cdn.uu126.cn/blog [R,L]
Apache用.htaccess来实现强制https访问
https://blog.057000.xyz/posts/2016-12-05-2400/