Adding wildcard to beginning of URL rule

The issue I want to solve is to correctly process URLs such as: /parent10/parent9/parent9/…/rewrite

All processing starts with the rewrite, so my rules right now look like:




'<rewrite:\w+>'=>'content/render/page/rewrite/<rewrite>',

'<parent1:\w+>/<rewrite:\w+>'=>'content/render/page/rewrite/<rewrite>/parent/<parent1>',

'<parent2:\w+>/<parent1:\w+>/<rewrite:\w+>'=>'content/render/page/rewrite/<rewrite>/parent/<parent1>,<parent2>',

'<parent3:\w+>/<parent2:\w+>/<parent1:\w+>/<rewrite:\w+>'=>'content/render/page/rewrite/<rewrite>/parent/<parent1>,<parent2>,<parent3>',



Ideally, something like this would be great:




'*/<rewrite:\w+>'=>'content/render/page/rewrite/<rewrite>',



However that throws up an error. On the other hand this works:




'<rewrite:\w+>/*'=>'content/render/page/rewrite/<rewrite>',



Any ideas on how to accomplish this?

Have you tried:

‘(.*)/<rewrite:\w+>$’=>‘content/render/page/rewrite/<rewrite>’,

Also notice that ‘’ is REGEXP operator so it cannot be used without preceding character/literal (like your '/<rewrite:\w+>’). this is not ‘*’ wildcard like in filenames or database LIKE ‘%’.

anyway - be careful as this is ‘catch all’ rule (almost any request in fact will be matched with this rule). You have to provide specific rules for other controllers/actions you have to use BEFORE this one (rules are evaluated in order they are written in config)