求一条apache的rewirte伪静态,实现http访问自动跳转到https

WBOY
Release: 2016-06-23 13:42:03
Original
1068 people have browsed it

如题。比如:

http://www.abc.com/
自动跳转到
https://www.abc.com/

http://www.abc.com/contact.html
自动跳转到
https://www.abc.com/contact.html

谢谢!


回复讨论(解决方案)

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://www.abc.com/$1 [R=301,L]

非常感谢版主的帮助!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!