1

I defined

routes.kategoriler.route               = ":lang/categories/:cat/:name"
routes.kategoriler.defaults.controller = "category"
routes.kategoriler.defaults.action     = "index"


routes.categories.route               = ":lang/:type/:cat/:name"
routes.categories.defaults.controller = "types"
routes.categories.defaults.action     = "index"

type catches "categories" word. I put definitions before and after but no way. Can you offer a solution?

Charles
  • 50,943
  • 13
  • 104
  • 142
nerkn
  • 1,867
  • 1
  • 20
  • 36

3 Answers3

2

Use a requirement for type to do not match 'categories'. Like this:

routes.categories.reqs.type = "[^categories]"

Sadly my regex skills aren't on the top, so you might want to rewrite it (It's a little ugly, and it disapproves anything that contains 'categories', but it gives you the idea.)

sallaigy
  • 1,524
  • 1
  • 13
  • 12
1

using hint from Regular expression to match a line that doesn't contain a word?

routes.categories.reqs.type_name        =  "^((?!categories).)*$"

Solved my case

Community
  • 1
  • 1
nerkn
  • 1,867
  • 1
  • 20
  • 36
0

To be able to accept anything except the exact match of "categories" use the below regexp

^((?!^categories$).)*$

this will allow you to use the type as "my-categories" or "categories-of-products" or anything else that is not an exact match of "categories"