- 需求 当用户地址栏输入 www.lunghealthbiotech.com/ 或者 www.lunghealthbiotech.com/sign/login/
会自动跳转到 https://www.lunghealthbiotech... 或者 https://www.lunghealthbiotech...
- 服务器为 linux ubuntu phpstudy
- 现在https 以生效
会自动跳转到 https://www.lunghealthbiotech... 或者 https://www.lunghealthbiotech...
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
在.htaccess文件中写入如下配置
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R]
上面说的都是apache配置,这里我提供另外一种思路
可以通过apache指定http访问一个目录下 index.html
然后 文件利用
<meta http-equiv="refresh" content="0; url=https://www.xxx.com/" />
即可跳转
2 回答2.5k 阅读✓ 已解决
2 回答1.1k 阅读✓ 已解决
1 回答851 阅读✓ 已解决
2 回答525 阅读✓ 已解决
943 阅读
2 回答566 阅读
1 回答685 阅读
我对apache不熟悉,但是如果没记错的话,使用下面的 htaccess