Apache自动跳转到 HTTPS 2017-07-22 来源:网络 字号:大 中 小 我要评论 收藏本文
网站根目录新建 .htaccess
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L] 301跳转 <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{SERVER_PORT} !^443$ RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L] </IfModule> 站点绑定多个域名,只允许www.gworg.com 跳转 RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^example.com [NC,OR] RewriteCond %{HTTP_HOST} ^www.example.com [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L] ###把网址更改为自己的### 高级用法 (可选) RewriteEngine on # 强制HTTPS RewriteCond %{HTTPS} !=on [OR] RewriteCond %{SERVER_PORT} 80 # 某些页面强制 RewriteCond %{REQUEST_URI} ^something_secure [OR] RewriteCond %{REQUEST_URI} ^something_else_secure RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] # 强制HTTP RewriteCond %{HTTPS} =on [OR] RewriteCond %{SERVER_PORT} 443 # 某些页面强制 RewriteCond %{REQUEST_URI} ^something_public [OR] RewriteCond %{REQUEST_URI} ^something_else_public RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] |
相关热词搜索:
上一篇:把ssl模块加入到已经编译好的apache中(以wdlinux系统为例)
下一篇:最后一页
看完本文,您的心情是?
分享到:
收藏
评论排行
- ·如何清除DNS缓存 使用命令清理dns缓存方法(2)
- ·Win8.1升级Win10遇到错误代码0xc190010...(1)
- ·Windows RT 8.1 Update 3九月发布 ...(0)
- ·如何将ubuntu安装到U盘实现即插即用(0)
- ·微软否认Xbox One有远程关闭开关(0)
- ·Surface Book详细拆解:千万不要自己动手修(0)
- ·WIN10免费升级正版手册(5分钟读懂WIN10...(0)
- ·你的今日头条账号为什么会被封?(0)
- ·win7电脑怎么翻墙看国外的网站?(0)
- ·shell脚本运行5秒后自动退出的代码(0)
- ·jsp 不支持EL表达式,解决办法(0)
- ·table合并单元格与img图片铺满整个td的html(0)
- ·Mac OS X 系统备份指南(0)
- ·Shell脚本注释写法(0)
- ·windows8激活码、序列号、激活密钥、激...(0)
- ·从一个不错的留言本弄的mysql数据库操作类(0)
- ·PHP漏洞全解(详细介绍)(0)
- ·phpBB BBcode处理的漏洞(0)
- ·安装Win10技术预览版有风险吗?win10预...(0)
- ·基于mysql的论坛(6)(0)
猜你喜欢
- ·启动Apache时提示错误“Cannot load ph...
- ·Apache自动跳转到 HTTPS
- ·apache+php5.4+Zend Guard Loader 的安装方法
- ·apache2.4配置cgi和fastcgi
- ·Apache2.2+fastCGI+(多版本)PHP配置
- ·把ssl模块加入到已经编译好的apache中(以...
- ·apache防盗链 简单预防与技术详解
- ·Apache和Nginx防盗链的几种配置方法
- ·Zend Guard Loader的配置与安装
- ·Apache错误:the requested operation ...
- ·如何让APACHE支持.htaccess
- ·解决Apache/PHP无法启动的问题
- ·Windows里配置Apache2.2+PHP5.3+mod_fcgi...
- ·Apache在fastcgi模式运行PHP上传文件时Ma...
热门推荐
- ·如何让APACHE支持.htaccess
- ·Windows里配置Apache2.2+PHP5.3+mod_fcgid运行高效的FastCGI模式
- ·Apache和Nginx防盗链的几种配置方法
- ·Apache自动跳转到 HTTPS
- ·apache防盗链 简单预防与技术详解
- ·Apache2.2+fastCGI+(多版本)PHP配置
- ·apache+php5.4+Zend Guard Loader 的安装方法
- ·Apache错误:the requested operation has failed 的解决方法
- ·解决Apache/PHP无法启动的问题
- ·Apache在fastcgi模式运行PHP上传文件时MaxRequestLen错误解决方法
- ·把ssl模块加入到已经编译好的apache中(以wdlinux系统为例)
- ·Zend Guard Loader的配置与安装
- ·apache2.4配置cgi和fastcgi
- ·启动Apache时提示错误“Cannot load php5apache2_2.dll into server”
本月排行
- Windows里配置Apache2.2+PHP5.3+mod_fcgid运行高效的FastCGI模式
- Zend Guard Loader的配置与安装
- Apache2.2+fastCGI+(多版本)PHP配置
- apache防盗链 简单预防与技术详解
- Apache和Nginx防盗链的几种配置方法
- 如何让APACHE支持.htaccess
- 启动Apache时提示错误“Cannot load php5apache2_2.dll into server”
- Apache错误:the requested operation has failed 的解决方法
- 解决Apache/PHP无法启动的问题
- apache+php5.4+Zend Guard Loader 的安装方法
最近更新
- ·Apache自动跳转到 HTTPS
- ·把ssl模块加入到已经编译好的apache中(以wdlinux系统为例)
- ·Apache在fastcgi模式运行PHP上传文件时MaxRequestLen错误解决方法
- ·apache2.4配置cgi和fastcgi
- ·Apache2.2+fastCGI+(多版本)PHP配置
- ·Zend Guard Loader的配置与安装
- ·apache+php5.4+Zend Guard Loader 的安装方法
- ·Windows里配置Apache2.2+PHP5.3+mod_fcgid运行高效的FastCGI模式
- ·解决Apache/PHP无法启动的问题
- ·Apache错误:the requested operation has failed 的解决方法
- ·启动Apache时提示错误“Cannot load php5apache2_2.dll into server”
- ·如何让APACHE支持.htaccess
- ·Apache和Nginx防盗链的几种配置方法
- ·apache防盗链 简单预防与技术详解