1.LAMP或者LNMP集成环境跳转:
首先在网站根目录下创建.htaccess文件,如果目录下已经有.htaccess文件,则用vi或者其他编辑器打开,在最下面添加写入如下语句即可
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
2.Apache服务器:
1.LAMP或者LNMP集成环境跳转:
首先在网站根目录下创建.htaccess文件,如果目录下已经有.htaccess文件,则用vi或者其他编辑器打开,在最下面添加写入如下语句即可
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
2.Apache服务器:
NameSilo.com是一家非常棒的国外域名注册商,主要是价格非常便宜,而且还提供免费隐私保护。
如果想要域名备案,就必须将域名转入国内,进行实名认证。
下面,仅对namesilo域名转出提供图文教程:
现在腾讯提供免费的一年证书,地址:https://console.qcloud.com/ssl
nginx重定向 http 自动跳转 https
server
{
listen 80;
server_name blog.luoli.net;
index index.html index.htm index.php;
rewrite ^/(.*)$ https://blog.luoli.net/$1 permanent; //第一种
return 301 https://www.baidu.com$request_uri; //第二种
}
配置ssl证书: