Why server ignores GET parameters in Paterna MVC?

In General a situation such, decided to start to study mvc, on the hub there is an article about mvc pattern, here it is
but the only problem is that you can't pass paramter get in the link just throws me to the 404 page, tell me what to do? how to fix it these things act?
and here is code of the router
<?php

/*
Class router to determine the requested page.
--> touches the controller classes and models.
> creates instances of controllers, pages, and causes of action of these controllers.
*/
class Route
{

 static function start()
{
 // controller and default action
 $controller_name = 'Main';
 $action_name = 'index';

 $routes = explode('/', $_SERVER['REQUEST_URI']);

 // get the controller name
 if ( !empty($routes[1]) )
 { 
 $controller_name = $routes[1];
}

 // get name of action
 if ( !empty($routes[2]) )
{
 $action_name = $routes[2];
}

 // add the prefixes
 $model_name = 'Model_'.$controller_name;
 $controller_name = 'Controller_'.$controller_name;
 $action_name = 'action_'.$action_name;

/*
 echo "Model: $model_name <br>";
 echo "Controller: $controller_name <br>";
 echo "Action: $action_name <br>";
*/

 // hook the file with the class model (the model file may not be)

 $model_file = strtolower($model_name).'.php';
 $model_path = "application/models/".$model_file;
if(file_exists($model_path))
{
 include "application/models/".$model_file;
}

 // hook the file with a controller class
 $controller_file = strtolower($controller_name).'.php';
 $controller_path = "application/controllers/".$controller_file;
if(file_exists($controller_path))
{
 include "application/controllers/".$controller_file;
}
else
{
/*
 it would be correct to throw an exception here
 but to simplify will do a redirect to the 404 page
*/
Route::ErrorPage404();
}

 // create the controller
 $controller = new $controller_name;
 $action = $action_name;

 if(method_exists($controller, $action))
{
 // call controller action
$controller->$action();
}
else
{
 // here also it would be wiser to throw an exception
Route::ErrorPage404();
}

}

 ErrorPage404 function()
{
 $host = 'http://'.$_SERVER['HTTP_HOST'].'/';
 header('HTTP/1.1 404 Not Found');
 header("Status: 404 Not Found");
header('Location:'.$host.'404');
}

}

I'm new to php, please help someone, just describe how to fix it, and preferably with examples
July 2nd 19 at 13:45
1 answer
July 2nd 19 at 13:47
Solution
fixed, need to replace it
$routes = explode('/', $_SERVER['REQUEST_URI']);
it
$uri = $_SERVER['REQUEST_URI'];
 $position = strpos($uri, '?');
 if ($position !== false) {
 $uri = mb_substr($uri, 0, $position);
}
 $routes = explode('/', $uri);

Find more questions by tags MVCPHPWeb Development