我在openshift rhc中有兩個站點。對於第一個我使用cloudflare和tk域的名稱www.elasa.ir並設置我的第一個網站的名稱first.rhcloud.com。如何通過openshift中的.htaccess文件從舊域名重定向到新的子域名rhc
我想有一個類似於dl1.example.com的第一個域的子域,它重定向到openshift rhc中的第二個站點。
我在openshift RHC爲CNAME的secondry網站加入dl1.example.com,並將其設置爲secondery-.rhcloud.com到shope.elasa.ir 和cloudeflare設置爲example.com。
我添加了一個CNAME記錄的指點shope.elasa.ir到secondery-.rhcloud.com 最後通過點擊dl1.example.com它顯示了輔助站點,卻接連單擊地址欄更改爲secondery-.rhcloud.com。 那麼我必須爲重定向secondery-.rhcloud.com子域(dl1.exmple.com)爲所有的時間做:
我加入這個代碼.htaccess文件:
Options +SymLinksIfOwnerMatch
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?tomatocart-beyhagh.rhcloud\.com$ [NC]
RewriteRule ^(.*)$ "http\:\/\/shope\.elasa\.ir\/$1" [R=301,L]
但我得到以下錯誤:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.