I follow the Jaburo.net. https only allow at login page not overall page. That is good news but somehow it always say can’t establish a connection to the server at localhost when i click the https://.../login page and other pages still work fine using http. Anyone face this problem before?
My code below
protected/components/HttpsFilter.php
class HttpsFilter extends CFilter {
protected function preFilter( $filterChain ) {
if ( !Yii::app()->getRequest()->isSecureConnection ) {
# Redirect to the secure version of the page.
$url = 'https://' .
Yii::app()->getRequest()->serverName .
Yii::app()->getRequest()->requestUri;
Yii::app()->request->redirect($url);
return false;
}
return true;
}
}
protected/components/Controller.php
class Controller extends CController
{
public $breadcrumbs=array();
public function filterHttps( $filterChain ) {
$filter = new HttpsFilter;
$filter->filter( $filterChain );
}
}
controllers/SiteController
public function filters()
{
return array(
'https +login', // Force https, but only on login page
);
}
Sorry for my bad english. I want user to pass through https:// method for login page and other pages using http. The source for Jaburo net can work but some how it always say can’t establish a connection to the server at localhost when i click the https://.../login page.
What is your server configuration whether you installed ssl in localhost?
I now using apache as server configuration.
Can tell me what is the configuration step for apache if want install ssl in localhost?? I find some method but it still can’t work.