views:

304

answers:

1

Hi all,

I'm interested in supporting English and French in my Grails app with user-friendly URL.

format: /appname/language/controller/action

example: /store/en/product/list

What is the best way without passing as a parameter (?lang=fr) then rewriting the URL.

Thanks

+1  A: 

Adding the following mapping in your appname\grails-app\conf\UrlMappings.groovy should do it.

"/$lang/$controller/$action?/$id?"{

}

See the URL mapping article on the grails website for details.

rochb