htaccess:将所有请求重定向到https:// www(不包括子域)

时间:2018-09-19 11:15:11

标签: .htaccess mod-rewrite

我在找什么?

我需要一种将所有流量重定向到https://www.domain ....

的方法。

所以:

http://domain.nl

http://www.domain.nl

https://domain.nl

https://www.domain.nl

需要产生https://www.domain.nl

接下来,我有一个子域,必须通过: https://sub.domain.nl

编辑:该子域正在运行,但无法重定向到https。 其他所有功能均按我的要求运行。

到目前为止,我已经知道了:     RewriteEngine开     RewriteBase /

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteCond %{HTTP_HOST} !^m\.domain\.nl$ [NC]
RewriteRule ^ https://www.domain.nl%{REQUEST_URI} [L,NE,R=301]

0 个答案:

没有答案