2013-09-22 55 views
0

我試圖使用API​​的一個,所以他們發送的響應如 https://domain.com/controller/action 但該頁面返回500錯誤。YII。從https重定向到http

我已經嘗試使用這種

class HttpFilter extends CFilter { 
    protected function preFilter($filterChain) { 
     if (Yii::app()->getRequest()->isSecureConnection) { 
      # Redirect to the secure version of the page. 
      $url = 'http://' . 
       Yii::app()->getRequest()->serverName . 
       Yii::app()->getRequest()->requestUri; 
      Yii::app()->request->redirect($url); 
      return false; 
     } 
     return true; 
    } 
} 

RewriteCond %{SERVER_PORT} !^443$ 
RewriteCond %{HTTPS} !on 
RewriteCond %{REQUEST_URI} ^/charge/chargePrivatResult$ [NC] 
RewriteRule ^(.*)$ https://domain.com/$1 [L,R=301] 

但它並沒有幫助。 我該怎麼辦?

回答