I have tried to redirect add page when url has sub domain name. but its not working.
My code in routes.php
if($_SERVER['HTTP_HOST']=='username.mysite.com'){
$route['default_controller'] = 'advertisement/addAdvertisement';
}
else{
$route['default_controller'] = 'Home';
}
$_SERVER['HTTP_HOST'] returns host name. if the host name is "username.mysite.com" (this is subdomain) means it will redirect to "mysite.com/advertisement/addAdvertisement". otherwise it will go to mysite.com only