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

[eluser]Gewa[/eluser]
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
Code:
$route['link/:any'] = "/redirect/goto";

to route.php, but the variable is not passing and i get
Code:
[b]$name variable is not set[/b]
error...
here is my full route.php
Code:
$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";
#2

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

[eluser]Gewa[/eluser]
oh thanks a lot!!!




Theme © iAndrew 2016 - Forum software by © MyBB