2017-07-18 78 views
-1

我的應用程序是在角JS這是對二級域名就像http://app.xyz.com我想它重定向到https://app.xyz.com這裏是htaccess的,我用來重定向重定向HTTP到HTTPS angularjs應用

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.xyz\.com$ 
RewriteRule ^(.*)$ https://%1/$1 [L] 

當網站負載第一次它的做工精細,但是當我再重裝我得到找不到網頁的錯誤,每次

感謝

回答

0

這將所有URL重定向到https.Try這個

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

它重定向我到https,但是當我試圖重新加載我的網頁,然後不工作,我得到找不到網頁的錯誤 –

+0

你使用任何其他重定向規則或任何重定向的cPanel –

+0

選擇不,我只是使用htaccess的強制重定向到https,不使用cpanel進行重定向 –