配置apache默认使用ssl的方法_Web服务器教程

编辑Tag赚U币
教程Tag:Apachessl添加

首先确认mod_rewrite已经安装,方法就是查看你的httpd.conf,搜索“LoadModule rewrite_module modules/mod_rewrite.so”,如果有,删除前面的"#"。

然后在下面添加,具体位置似乎没有大的关系,可以自行测试一下:


RewriteEngine On
RewriteRule /.* https://www.example.com/ [R]


替换URL为你需要的就好了。看到其它地方还添加了其他的选项,我这里就采用了最基本的官方说明了。有兴趣的可以自己在研究一下。
P: Apache的官方文档有个小错误,它用了http而不是https,那不是没用了么,呵呵。
参考:
http://httpd.apache.org/docs/1.3/misc/howto.html
http://www.cyberciti.biz/tips/howto-apache-force-https-secure-connections.html
http://www.linuxquestions.org/questions/fedora-35/configuring-automatic-redirects-from-port-80-to-port-443-with-bundled-apache-server-609598/

来源:网络搜集//所属分类:Web服务器教程/更新时间:2013-04-14
相关Web服务器教程