.htaccess 将http重定向到https angularjs应用程序

.htaccess 将http重定向到https angularjs应用程序,.htaccess,.htaccess,我的应用程序在angular js中,它位于子域上,我想将它重定向到这里,这是我用来重定向它的htaccess RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.xyz\.com$ RewriteRule ^(.*)$ https://%1/$1 [L] 当网站加载第一次它的工作很好,但当我重新加载,然后我得到的网页没有找到错误,每次 谢谢这将把所有URL重定

我的应用程序在angular js中,它位于子域上,我想将它重定向到这里,这是我用来重定向它的htaccess

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.xyz\.com$
RewriteRule ^(.*)$ https://%1/$1 [L]
当网站加载第一次它的工作很好,但当我重新加载,然后我得到的网页没有找到错误,每次


谢谢

这将把所有URL重定向到https。试试这个

# Redirect all url to https #
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

它会将我重定向到https,但当我尝试重新加载我的页面时,我无法工作,并且我得到页面未找到错误您是否在CPANELN中使用任何其他重定向规则或任何重定向选项?否,我只是使用htaccess强制重定向到https,而不使用cpanel进行重定向