Welcome Guest, Not a member yet? Register   Sign In
Please help with routing problem!

hi! routing in my application is not working , please help to fix ..

i need when i go to http://www.mysite.com/link/1865bd2d9bd63...0f98920d63
in my website, it to open /redirect controller, function go_to

and pass 1865bd2d9bd6386de8396e0f98920d63 as $name

I have controller redirect with function go_to($name)

so that the link http://www.mysite.com/link/1865bd2d9bd63...0f98920d63 will equall to http://www.mysite.com/redirect/goto/1865...0f98920d63

i added
$route['link/:any'] = "/redirect/goto";

to route.php, but the variable is not passing and i get
[b]$name variable is not set[/b]
here is my full route.php
$route['default_controller'] = "start";
$route['scaffolding_trigger'] = "";

$route['(\w{2})/(.*)'] = '$2';
$route['(\w{2})'] = $route['default_controller'];

//put dlja redirecta

           $route['link/:any'] = "/redirect/goto";

//menjajem put dlja auth-php .

      $route['login'] = "auth";

      $route['login'] = "auth/login";

      $route['logout'] = "auth/logout";

      $route['register'] = "myaccount/register";

      $route['activate/:any'] = "auth/activation";
    $route['changepass'] = "auth/changepassword";

      $route['forgpass'] = "auth/forgotten_password";

      $route['resetpass/:any'] = "auth/forgotten_password_reset";

$route['myaccount/show/:num'] = "myaccount/show";

$route['myaccount/edit/:num'] = "myaccount/edit";
$route['admin'] = "admin/adminhome";
$route['admin/users/:num'] = "admin/users";
$route['admin/admins/:num'] = "admin/admins";

[eluser]Pascal Kriete[/eluser]
Routes are regular expressions - you need a capture group in there:
$route['link/(:any)'] = "/redirect/goto/$1";

oh thanks a lot!!!

Theme © iAndrew 2016 - Forum software by © MyBB