Reply To: How to append Trailing Slash to the requested URL

Splash Forums Rewrite Users How to append Trailing Slash to the requested URL Reply To: How to append Trailing Slash to the requested URL

#25024

youngreymond
Participant

Hi,

this is working fine now
.addRule(Join.path("/web/home/").to("/faces/portal/home.xhtml"))

but I can not automatically add the slash when
.addRule(Join.path("/web/home").to("/faces/portal/home.xhtml"))
or better said this
http://localhost:8080/cmpPortal/web/home

I would like to automatically add the slash to get this
.addRule(Join.path("/web/home/").to("/faces/portal/home.xhtml"))
or better said this
http://localhost:8080/cmpPortal/web/home/

this is the Rule to append the slash

.addRule(TrailingSlash.append())
 .when(Path.matches("/{x}"))
 .where("x").matches("^(?!.*\\.xhtml.*).*$")