tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jieryn <jie...@gmail.com>
Subject Re: Apache Tomcat 7.x: Host+Alias and HTTP 301
Date Mon, 16 Sep 2013 13:53:56 GMT
Greetings,

On Sat, Jul 20, 2013 at 12:36 AM, jieryn <jieryn@gmail.com> wrote:
> I have multiple host names which resolve to the same
> application context, e.g. app.host1.com (host) and app.host2.com
> (alias). I have implemented this within conf/server.xml via Host and
> Alias definitions.

Just to close the loop here, I eventually did solve this with
URLRewrite filter. The documentation I was looking at was inaccurate
or maybe just mismatched against the version of the library being
used.. Alas, here is the working URLRewrite rule:

  <rule>
    <note>Domain name change from $OLDHOST1, with $OLDHOST2 Alias, to
$NEWHOST.</note>
    <condition type="server-name" operator="equal"
next="or">$OLDHOST1</condition>
    <condition type="server-name" operator="equal">$OLDHOST2</condition>
    <from>^(.*)$</from>
    <to last="true" type="permanent-redirect">http://$NEWHOST/$1</to>
  </rule>

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message