2015-12-02 21 views
0

我有一個要求,我必須將我的主機名重定向到同一個Apache上託管的特定應用程序。舉個例子,當我點擊主機(https://domain1.example.com)時,它應該在內部將我重定向到Apache Web應用程序(https://domain1.example.com/application1),而不更改瀏覽器URL。在同一個Apache中重定向https到https

我不知道如何實現SSL到SSL重定向。提前致謝..!!!

+0

什麼是SSL所要做的有了這個,如果你只想要一個_internal_重定向? – CBroe

+0

我有一個應用程序,我在DocumentRoot PATH_TO_APP中設置,我希望所有主機都應該指向同一應用程序,即domain1.example.com或domain2.example.com或domainN.example.com應該能夠訪問我的應用程序(域.example.com).. – Waheed

+0

這仍然不能解釋什麼SSL/HTTPS可以做到這一點 - 如果你的重定向只是_internal_。 – CBroe

回答

0

這應該工作。這將重定向要domain1.example.com/所有傳入的URL domain1.example.com/application1

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^domain1.example.com$ 
RewriteRule ^$ https://domain1.example.com/application1 [L,R=301] 
0

如果不改變瀏覽網址是你的目標,然後PROXY是你的方式。

放在你的Apache虛擬主機或全局文件之後,

ProxyPass https://domain1.example.com/ https://domain1.example.com/application1 
ProxyPassReverse https://domain1.example.com/ https://domain1.example.com/application1 

PS陳詞濫調無關這一點,至少你沒有提到的任何情況。

編輯

  1. ProxyPass應該來virtural主機不location

  2. 地全部location標籤應該出的virtual host

+0

的DocumentRoot 「E:\項目\項目\交付\ RFNG \ RF-IAM」 服務器名domain1.example.com SSLProxyEngine在 了SSLCertificateFile「C:\ Apache24 \證書\ IDP .CRT」 了SSLCertificateKeyFile 「C:\ Apache24 \證書\ idp.key」 \t \t進行AuthType陳詞濫調 \t \t ShibUseHeaders在 \t \t ShibRequestSetting的applicationID IAM \t \t ProxyPass http://domain.example.com/iam \t \t ProxyPassReverse https://domain.example。COM/IAM/ \t \t ShibRequestSetting requireSession真正 \t \t要求我不知道有效的用戶 ,我失去了什麼在這裏:( – Waheed

+0

我不明白你爲什麼需要有陳詞濫調! – Akshay

+0

,僅限註冊用戶可以訪問該應用程序。 – Waheed

相關問題