Reply To: Wilcard matching

Splash Forums Rewrite Users Wilcard matching Reply To: Wilcard matching

#27213

No, Rewrite is based on parameters which are represented by regular expressions. The default pattern for a parameter is [^/]*. But you can change that for each parameter. There is also a special parameter {*} that can be used if you are not interested in what is actually matched. Samples:

// matches /big/url/foobar but NOT /big/url/foo/bar 
.addRule(Join.path("/big/url/{param}").to("/something"))

// same as above
.addRule(Join.path("/big/url/{*}").to("/something"))

// matches both /big/url/foobar AND /big/url/foo/bar
.addRule(Join.path("/big/url/{param}").to("/something"))
.where("param").matches(".*")