从http非www重定向到https www

时间:2019-12-16 09:21:34

标签: redirect http-redirect

如果您转到http://icdcspares.com,则有两个重定向

http://icdcspares.com
301 Moved Permanently
https://icdcspares.com/
301 Moved Permanently
https://www.icdcspares.com/
200 OK

但是我想要从http://icdcspares.comhttps://www.icdcspares.com/的直接重定向,而不要经过https://icdcspares.com/。我该怎么办?

我的htaccess文件是这样的:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

0 个答案:

没有答案