2012-12-12 171 views

回答

0

這是一個古老的線程,但我想我會繼續前進,各地分享我的工作......

控制器添加到您的網站主頁,在init動作,重定向如果爭取頁面,還不是一個安全的頁面。

public PageReference init() { 
     String currentURL = Site.getCurrentSiteUrl(); 
     if (!startsWith(currentUrl, 'https://')) { 
      return redirect(currentURL.replace('http://', 'https://')); 
     } 

     return null; 
    }