Reply To: Map part of URL to Parameter

Splash Forums Rewrite Users Map part of URL to Parameter Reply To: Map part of URL to Parameter

#23825

You have to make sure that your patterns don’t match other resources. Generally it is a good idea to restrict the regex of the parameters as you did it. In case of your product page it would be a good idea to restrict the parameter to numbers:


.addRule(Join.path("/product/{id}").to("/view_product_details.xhtml"))
.where("id").matches("[0-9]+")

If you have problems with broken graphics or styles, please post the exact URL and all your rules.

For the home page it seems like you actually don’t use a parameter. Just use a string literal:


.addRule(Join.path("/Home").to("/Home.xhtml")

And I think you don’t need the .when(DispatchType.isRequest()) part.