E
E
Evgeny Shevtsov2016-06-11 01:46:59
CodeIgniter
Evgeny Shevtsov, 2016-06-11 01:46:59

How to get the right kind of uri in codeigniter?

I use three arguments when accessing the controller via _remap, a link of this format comes out,
site.com/art/1/rev/2respectively 1, rev, 2 - arguments.
I need this format to be converted to this 1.site.com/rev/2, via routes only works with the first parameter:

$subdom =  array_shift((explode(".",$_SERVER['HTTP_HOST'])));
switch ( $_SERVER['HTTP_HOST'] ) {
    case $subdom.'.site.com':
        $route['default_controller'] = "art/".$subdom;		
    default:
  
    break;
}

But if I add the remaining 2 parameters there - 404 page.
Actually the question is how do I pass 1 parameter as a subdomain, and the remaining 2 as regular arguments. ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question