Bug 51269 - Enhancement: Allow Alias to support wildcards
Summary: Enhancement: Allow Alias to support wildcards
Status: RESOLVED DUPLICATE of bug 18500
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: Unknown
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-26 12:59 UTC by xandrewrampulla
Modified: 2011-05-26 13:03 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xandrewrampulla 2011-05-26 12:59:43 UTC
I would like my tomcat instance to be able to respond to multiple DNS subdomains without having to explicitly specify those subdomains.  For example I would like to be able to create an alias that looks like

         <Host name="myapp" >
            <Alias>*.myapp.mycompany.com</Alias>
         </Host>

With this configuration, the server should respond properly to 
a.b.c.myapp.mycompany.com
b.c.d.myapp.mycompany.com
c.d.e.myapp.mycompany.com
etc.

This seems like it could be done easily by changing org.apache.catalina.connector.MapperListener:registerEngine so that instead of 
    if (aliases[i].equalsIgnoreCase(defaultHost)){
        isRegisteredWithAlias = true;
        break;
    }
we instead did something like
    if(Pattern.matches(alias[i].toLowerCase().replaceAll("\\*", ".*?"), defaultHost.toLowerCase())) {
        isRegisteredWithAlias = true;
        break;
    }
Comment 1 Mark Thomas 2011-05-26 13:03:57 UTC

*** This bug has been marked as a duplicate of bug 18500 ***