Apache配置http访问转https
来源:互联网 发布:苹果免费打电话软件 编辑:程序博客网 时间:2024/06/06 03:45
默认情况下,apache的80端口网站目录是/var/www/html
查找配置文件并修改/etc/httpd/conf/httpd.conf
利用伪静态功能
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All #原来是None,需要改成All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
然后在需要跳转的网站根目录,也就是80端口的网站根目录/var/www/html下创建一个.htaccess文件,如果目录下已经有.htaccess文件,则用vi或者其他编辑器打开,在最下面添加写入如下语句即可
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
保存,重启httpd服务,再次访问http://域名,发现会直接跳转到https://域名
配置成功。
0 0
- Apache配置http访问转https
- Apache配置http访问转https(widows和linux通用)
- apache配置https协议访问
- apache的https访问配置
- apache http与https配置
- apache http与https配置
- http转https访问
- nginx 配置https访问以及访问http跳转到https
- 在Apache配置https方式访问网站
- 服务器 apache配置https,http强制跳转https
- Tomcat配置https及访问http自动跳转至https
- Tomcat配置https及访问http自动跳转至https
- 【Tomcat】配置https及访问http自动跳转至https
- Lighttpd 启用 HTTPS 并重定向 HTTP 为 HTTPS 访问配置
- Tomcat配置https及访问http自动跳转至https
- Tomcat配置https及访问http自动跳转至https
- Tomcat配置https及访问http自动跳转至https
- Tomcat配置https,及访问http自动跳转至https
- 行为型:设计模式之访问者模式(二十三)
- 用流域和最佳的阈值进行慢性淋巴细胞性白血病细胞分割
- 工厂设计模式
- 嵌入式Linux学习-------Linux内核移植
- linux通过远程桌面访问windows
- Apache配置http访问转https
- 从数据库用户表在fastdfs文件系统批量创建头像一例
- iOS---如何把导航默认的返回按钮设置成“返回”
- C/C++面试题精选
- PHP+MySQL的操作
- UIGestureRecognizer手势识别详解
- List接口、ArrayList类和LinkedList类 笔记
- IOS 的 7 中手势的介绍 和详细使用(UIGestureRecognizer) UIScreenEdgePanGestureRecognizer
- centos6.4安装mysql5.5