我希望以下地址重定向到https://www.foobar.com
:
- http://www.foobar.com
- http://foobar.com
- https://foobar.com
我尝试过使用它,但它不起作用:
等/ httpd的/ conf.d / ssl_rewrite.conf
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
答案 0 :(得分:0)
RedirectMatch permanent ^(.*)$ https://www.foobar.com$1