Welcome Guest, Not a member yet? Register   Sign In
Session and subdomain issue
#4

[eluser]CodeMagician[/eluser]
My personal solution was to force the site to run without the "www". That way I knew it would work all the time. Eliminating the need for extensive testing.

I added this code to the top of my /config/config.php file. From line 2, place under BASEPATH security check that's found in line 1.

Code:
/* Remove www */
if(strpos($_SERVER['HTTP_HOST'],'www.')!==false) {
    $url = 'http://mydomain.com.au'.$_SERVER['REQUEST_URI'];
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: '.$url);
    exit();
}


Messages In This Thread
Session and subdomain issue - by El Forum - 08-04-2010, 02:32 PM
Session and subdomain issue - by El Forum - 08-05-2010, 09:42 AM
Session and subdomain issue - by El Forum - 08-05-2010, 10:05 AM
Session and subdomain issue - by El Forum - 08-11-2010, 05:25 AM
Session and subdomain issue - by El Forum - 08-11-2010, 07:31 AM
Session and subdomain issue - by El Forum - 08-11-2010, 11:31 PM
Session and subdomain issue - by El Forum - 08-11-2010, 11:34 PM
Session and subdomain issue - by El Forum - 08-12-2010, 12:40 AM
Session and subdomain issue - by El Forum - 08-12-2010, 04:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB