来哩HO
  • Centos
  • Web
    • AngularJS
    • CSS
  • Magento
    • Magento 主题
  • WordPress
    • WordPress 插件
  • 3D
    • Nomad
    • Procreate
  • Centos
  • Web
    • AngularJS
    • CSS
  • Magento
    • Magento 主题
  • WordPress
    • WordPress 插件
  • 3D
    • Nomad
    • Procreate

安装SSL证书后强制把Apache的http跳转到https

 Apache, Linux   2018/01/11   llh   1,475   0  

在配置文件 .conf 里添加以下语句:

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]

可以实现把http的网址强制跳转到https。

 标签:apache linux
上一篇:mysqldump 备份导出数据排除某些表 下一篇:Linux下用find命令查找最近修改过的文件

相关文章

  • CentOS dig: command not found 报错解决
  • Centos Linux 安装最新版本 mysql 5.7
  • Linux Centos 安装 rar
  • Centos 安装 Composer
  • Centos 安装配置 Apache mod_ssl 模块
  • Centos 安装 7ZIP
  • Linux Centos 硬件设备的文件名
  • Linux Centos How to resolve Another app is currently holding the yum lock
近期文章
  • yarn 不是内部或外部命令 也不是可运行的程序或批处理文件
  • VS Code使用Autoprefixer插件给样式自动添加浏览器所需前缀
  • HBuilderX 无法启动小程序开发者工具
  • Magento2 备份命令执行报错 Backup functionality is disabled
  • C4D 添加灯光后物体变成黑色
© 2018 来哩HO All Rights Reserved - Powered by Sanker -- 粤ICP备17157902号