.htaccess 使用htaccess将子域重定向到https

.htaccess 使用htaccess将子域重定向到https,.htaccess,redirect,mod-rewrite,https,subdomain,.htaccess,Redirect,Mod Rewrite,Https,Subdomain,我只想将所有URL从一个子域重定向到https 我的URL应该是 使用此代码,我将被重定向到带有https的主页,并且路径将被删除: RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^(nip)\. [NC] RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R] 有谁能给我一个提示,如何保持域名后面的路径? 谢谢 理想情况下不应删除路径,因为您使用的是%{REQUEST\u URI}

我只想将所有URL从一个子域重定向到https

我的URL应该是

使用此代码,我将被重定向到带有https的主页,并且路径将被删除:

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(nip)\. [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
有谁能给我一个提示,如何保持域名后面的路径?
谢谢

理想情况下不应删除路径,因为您使用的是
%{REQUEST\u URI}