Showing posts with label no-www. Show all posts
Showing posts with label no-www. Show all posts

Monday, May 02, 2011

Grails Subdomain Redirects

Since I'm using Cloudbees Run@Cloud service to host Scripty Note, I don't have access to their nginx configuration files (somewhat annoying). Since the nature of ScriptyNote is to be small, then we need to automatically remove the 'www' subdomain on any incoming requests and 301 redirect back to the no-www url. I posted a question here on stackoverflow and a very nice gentleman let me in on the Grails Filters convention. So here's the code I ended up implementing to redirect from 'www.scriptynote.com' to 'scriptynote.com'.