UrlMapping to static files in Grails -
i want map static files sitemap.xml , robots.txt located in web-app directory. urls should follows:
http://www.mydomain.com/sitemap.xml http://www.mydomain.com/robots.txt
how have set url mapping make these routes work?
i use mapping robots.txt
:
"/robots.txt" (view: "/robots")
and have grails-app/views/robots.gsp
contains content robots.txt
. way can use <g:if env="...">
have different content different environments.
in order work ".xml" extension, need change content negotiation config.
grails.mime.file.extensions = false // disables parsing of file extensions urls request format
Comments
Post a Comment