Question

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 :)

Était-ce utile?

La solution

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

Here is one easy, fast and clean route :)

Please read Documantation before asking.. CI Routing

Autres conseils

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

$route['categorie/(:num)']
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top