Rewriting a CI url Rewriting a CI url codeigniter codeigniter

Rewriting a CI url


This could be too simple of a solution but why not in your routing config do something simple like

in your config do something like

if ($_SERVER['SERVER_NAME'] == 'm.myhost.tld')    $route['default_controller'] = "mobile";

This would make the default controller mobil so you wouldn't have to have /mobile...

As i said maybe too simple


EDIT: Doesn't work, but maybe someone can turn it into something that does

Try this:

RewriteCond $1!^mobile/RewriteCond %{HTTP_HOST} ^m\.myhost\.tldRewriteRule (.*) /mobile/$1 [L]