0

I have an url like this:

http://kees.een-site-bouwen.nl/home/categorie/11

to show factories in a specific category.

I want to have an url like this:

http://kees.een-site-bouwen.nl/categorie/11

but when i use the url routing in my config/routes file like this:

$route['categorie'] = 'home/categorie';

it does not work. am i missing something?

The working link to the page is:

echo '<a href="'.base_url().'home/categorie/'.$value->idcategorieen.' ">' .$value->Categorie. '</a>';

The link that does not work is:

echo '<a href="'.base_url().'categorie/'.$value->idcategorieen.' ">' .$value->Categorie. '</a>';

Hope someone can help me :)

Kees Sonnema
  • 5,759
  • 6
  • 51
  • 106

2 Answers2

1
$route['categorie/(:num)'] = 'home/categorie/$1';

Here is one easy, fast and clean route :)

Please read Documantation before asking.. CI Routing

Svetoslav
  • 4,686
  • 2
  • 28
  • 43
  • sorry i forgot. but i tried that already but the fact was that i missed the /$1 thanks for pointing me at it :) i will accept when i'm allowed to. – Kees Sonnema Apr 17 '13 at 08:27
1

You are missing to to mention the argument i.e 11 to like this

$route['categorie/(:num)']
chandresh_cool
  • 11,753
  • 3
  • 30
  • 45