Re: Redirect everything except start page to https

2015-05-01 Thread Athanassios


Τη Τετάρτη, 29 Απριλίου 2015 - 1:09:45 μ.μ. UTC+3, ο χρήστης Sven Mäurer 
έγραψε:
>
> In my config file I have created two VirtualHosts. Below is the config 
> that redirects to 443 where everything is configured and working. Now I 
> want to make the startpage reachable without ssl but not the other pages. 
> How can I achieve that?
>
> RewriteEngine On
> RewriteCond %{HTTPS} off
> RewriteRule (.*) https://..
>
Back in the days of CakePHP 1.3, I did something similar by adding the 
following code in my controllers beforeFilter() function.
I believe this will also work with CakePHP 2 as well.

// make sure that we are using ssl protocol
if (!isset($_SERVER['HTTPS']))
 $this->redirect('https://' . $_SERVER['SERVER_NAME'] . 
$this->here);

HTH 
Athanassios

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Redirect everything except start page to https

2015-04-29 Thread Sven Mäurer
 

In my config file I have created two VirtualHosts. Below is the config that 
redirects to 443 where everything is configured and working. Now I want to 
make the startpage reachable without ssl but not the other pages. How can I 
achieve that?

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://..

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.