从http重定向到https不起作用(.htaccess)

时间:2020-05-28 12:10:03

标签: .htaccess redirect http-redirect

我正在尝试将对我的网站的所有请求从非www重定向到www以及从http重定向到https:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^my-domain\.de [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

现在,我仍然可以打开http://www.my-domain.de,而无需将其重定向到https:// ...

在此先感谢您的帮助!

0 个答案:

没有答案