Setting a custom root URL in Play 2.0

筅森魡賤 提交于 2019-12-21 04:50:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!