Reply To: Parameter that matches over slashes

Splash Forums Rewrite Users Parameter that matches over slashes Reply To: Parameter that matches over slashes

#25770

Do you want to redirect or do you want to use a join? For a join it would look like this:

.addRule( Join.path("/{whatever}").to("{whatever}.xhtml") )
.where("whatever").matches(".+")

However, you have to be very careful with such rules, because they will also match CSS resources and images which typically means that your site will break.

My recommendation is to either use a number of specific joins to capture individual pages like this:

.addRule( Join.path("/login").to("/faces/login.xhtml") )

Or fine tune your regular expressions so that images and CSS files do not match. You could for example do this by excluding . from the allowed characters.

.addRule( Join.path("/{something}").to("/{something}.xhtml") )
.where("something").matches("[^\\.]+");

This would for example match /login and /some/where but NOT /styles/default.css.