Is it possible to have cascade routing with default UrlRule?

Hi all,

We got a crazy idea to use cascade routing in our use case. The cascade routing we want is to translate url path into key-value pair parameter, like:

  • ‘/main/draw/test/edit/1’ will be translated to ‘/main/draw/test?edit=1’, or

  • ‘/main/draw/test/merge/1/to/5’ will be translated to ‘/main/draw/test?merge=1&to=5’

Please assume we have a controller named ‘draw’ with action named ‘test’ and ‘main’ is our module.

We had created a rule for this case:

This rule only supports a single parameter. It should translate ‘/main/draw/test/edit/1’ to ‘/main/draw/test?edit=1’.

When we run the test, it gives us 404. The log outputs:

From the log, we can find that ‘/main/draw/test/edit/1’ had translated into ‘/main/draw/test?edit=3’. We had confirmed that ‘/main/draw/test?edit=3’ is correct and had correct output.

Any ideas?

Not tested, but I think this may be ok.

‘main/<controller:\w+>/<action:\w+>/merge/<merge:\d+>/to/<to:\d+>/’ => ‘/main/<controller>/<action>’

No. You need custom URL rule.

Thanks! You save my time…