问题
I have a play appliaction that works if It is the root of the web host however I want to load it as a sub-url of my host
That is
http://example.com/ <- This works fine and i want to move to it
http://example.com/AwesomePlayApplication/ <- This want me to rewrite all the routes
Is there a way to just set a custom root URL that will translate all my configured routes?
回答1:
Add the following configuration key in your conf/application.conf file:
application.context="/AwesomePlayApplication"
回答2:
As stated by James Roper on google groups : Play 2.0.* does not support running on a different context yet, but Play 2.1 will.
来源:https://stackoverflow.com/questions/9994917/setting-a-custom-root-url-in-play-2-0