Skip to content

Instantly share code, notes, and snippets.

View egalles79's full-sized avatar

Eloi egalles79

View GitHub Profile
@egalles79
egalles79 / routes
Created April 29, 2014 11:26
Problems with subdomains and routes
$subdomain = substr( env("HTTP_HOST"), 0, strpos(env("HTTP_HOST"), ".") );
Configure::write('captacion', '');
if( strlen($subdomain)>0 && $subdomain != "m" ) {
Router::connect('*',array('controller'=>'private','action'=>'promote'));
// Router::connect('/foo', array('controller'=>'mobiles','action'=>'foo'));
Configure::write('captacion', $subdomain);
}