The problem with the mobile version of the template

Hello, I have a problem.
I made a mobile version of the template with the name ddevel_mobile
In the file start.php added

if ($ _SERVER ["HTTP_HOST"] == 'mobile.ddevel.org'
   or $ _SERVER ["HTTP_HOST"] == 'www.mobile.ddevel.org'
   or $ _SERVER ["HTTP_HOST"] == 'localhost'
   ) {

  / / viewtype == ddevel_mobile - instead of the default
  elgg_set_viewtype ('ddevel_mobile');
} else {
  / / viewtype == default
  elgg_set_viewtype ('default');
}

Now if I open the site to the link mobile.ddevel.org
I have opened a website with a mobile template, but all the internal links were left without the subdomain. For example ddevel.org/activity
How do I