Welcome Guest, Not a member yet? Register   Sign In
routes and https
#1

[eluser]rossmurphy[/eluser]
does anyone know how i would route from a https > http for any uri in the games folder?

Something like this maybe?

Code:
$route['games/:any'] = insecure_base_url()."/games/where-ever-they-were-headed";

Not quite sure how to do it,


cheers
#2

[eluser]bretticus[/eluser]
Here's an older post.
#3

[eluser]designfellow[/eluser]
Hi,
I think your method is right one.
Try that method ;-)
if doesnt work, we will find out another way.
#4

[eluser]rossmurphy[/eluser]
thanks guys, some great and elegant solutions in that other thread.

Think im going to create a force_ssl() helper and redirect, but will also investigate routing and see if i can't improve on this. Will post results.

Here is the helper function from the other thread though...

Code:
if ( ! function_exists('force_ssl'))
{
    function force_ssl()
    {
        $CI =& get_instance();
        $CI->config->config['base_url'] = str_replace('http://', 'https://', $CI->config->config['base_url']);
        if ($_SERVER['SERVER_PORT'] != 443)
        {
            redirect($CI->uri->uri_string());
        }
    }
}




Theme © iAndrew 2016 - Forum software by © MyBB