【发布时间】:2010-12-29 08:03:15
【问题描述】:
我目前正在使用以下相当繁琐的“servlet 样式”方法进行 Grails 301 URL 重定向:
def action = {
...
if (shouldRedirect) {
response.status = 301
response.setHeader("Location", "http://url/to/redirect/to.html")
render("")
return false
}
...
}
有没有更简洁、更紧凑的 Groovy/Grails 方式来执行 301 重定向?
请注意,我说的是 301 重定向,而不是可以使用标准 Grails redirect(...) 机制实现的标准 302 重定向。
【问题讨论】:
标签: grails seo http-status-code-301