Grails 开发环境中的URL过滤器?

Grails 开发环境中的URL过滤器?,grails,development-environment,tuckey-urlrewrite-filter,Grails,Development Environment,Tuckey Urlrewrite Filter,我正在使用URLRewiteFilter将所有请求转发到我的域,以“www”版本进行搜索引擎优化。 我有一个基本规则: <rule> <name>Domain Name Check</name> <condition name="host" operator="notequal">www.mydomain.com</condition> <from>/.*</from> <to type="permanen

我正在使用URLRewiteFilter将所有请求转发到我的域,以“www”版本进行搜索引擎优化。 我有一个基本规则:

<rule>
<name>Domain Name Check</name>
<condition name="host" operator="notequal">www.mydomain.com</condition>
<from>/.*</from>
<to type="permanent-redirect">http://www.mydomain.com</to>
</rule>

域名检查
www.mydomain.com
/.*
http://www.mydomain.com
这对生产非常有用,但当我在开发模式下运行时,它也会将我的域从
localhost:8080/mysite
更改为
www.mydomain.com

我如何为开发模式解决这个问题?我使用的是Grails和Tomcat,所以所有东西都捆绑在一个部署到服务器的.war中


谢谢

您可以尝试在
BuildConfig.groovy
中添加此项以排除依赖项吗?(前提是您没有在
lib
中添加jar)

如果这不起作用,那么在我看来,最安全的方法是分叉/克隆(使用最新版本的
urlrewritefilter:4.0.3
)并通过添加以下元素修改
UrlRewriteGrailsPlugin.groovy

def environments = ['prod'] //or 'production'
def scopes = [excludes:'run'] //If you normally use run-app in development

使用插件而不是添加依赖项。

您不必排除库。相反,您可以为开发和生产进行定义。您只需在生产中包含URLRewiteFilter。

是否使用?不,我只是手动拉入文件。那看起来很旧,没有评论。
def environments = ['prod'] //or 'production'
def scopes = [excludes:'run'] //If you normally use run-app in development