Welcome Guest, Not a member yet? Register   Sign In
Domain & Subdomain Masking
#2

[eluser]psychobob[/eluser]
I just wanted to let you know that the proposed method did 'work'. I'm not sure if it leaves me open to any particular security risks, so if anyone has any insight on that, I'd appreciate it.

Final Code in /system/application/config/config.php:
Code:
//change the base_url variable dynamically so we can globalize
            // Get the current host, or 'referrer'
            $ref = $_SERVER['HTTP_HOST'];
            // separate it into parts
            $dom=explode(".",$ref);
            if(count($dom)>=3) // in my case I want to make sure there's a subdomain
            {
                $config['base_url']    = "http://".$dom[0].'.'.$dom[1].'.'.$dom[2]; // config dynamic if everything is true
            } else {
                $config['base_url']    = "http://somedomain.com"; // config hardcoded url if not
            }


Messages In This Thread
Domain & Subdomain Masking - by El Forum - 10-20-2010, 01:29 PM
Domain & Subdomain Masking - by El Forum - 10-21-2010, 12:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB