What is the best way to redirect a www subdomain within a grails webapp
I d开发者_C百科on't have access to any of the underlying architecture, so within my Grails webapp I have to be able to perform the redirect. When requests come in for http://www.scriptynote.com I need to return a 301 redirecting to http://scriptynote.com . I'm assuming there is some way to do this within the UrlMappings file? Thanks for any help out there!
You can create a filter, e.g. DomainFilter
where you can check if there's www as subdomain, and if so, redirect to http://mysite.com
精彩评论