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

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

WBOY
WBOYOriginal
2016-06-23 13:42:031069browse

如题。比如:

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]

非常感谢版主的帮助!

Statement:
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