如何为子域实现grails Url Mapping(How can I implement grails Url Mapping for subdomains)

编程入门 行业动态 更新时间:2024-10-27 00:25:32
何为子域实现grails Url Mapping(How can I implement grails Url Mapping for subdomains)

我想为grails中的sub.mysite.com sub2.mysite.com等子域实现Url映射。 现在最好的解决方案是通过nginx / lighttpd进行一些重写。 但是有可能通过原生Grails Url映射功能吗?

I want to implement Url mapping for subdomains like sub.mysite.com sub2.mysite.com in grails. The best solution for now is to do some rewriting via nginx/lighttpd. But is it possible via native grails Url mapping features ?

最满意答案

UrlMappings不适用于Web服务器中的完整URL重写。 UM仅用于“服务器URL”(应用程序根目录)之后的URL部分。 如果Web服务器中的重写规则对您来说不够,您还可以实现自己的过滤器并将其注册到web.xml,但是您的帖子没有提供足够的信息来决定;-)

UrlMappings are not meant for full URL rewrite like in web server. The UM are only for the the part of URL after "server URL" (application root). If the rewrite rules in web server are not sufficient for you, you can also implement your own filter and register it to the web.xml, but your post does not provide enough information to decide ;-)

更多推荐

本文发布于:2023-07-17 07:38:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1141044.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:何为   grails   Url   subdomains   implement

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!