users@glassfish.java.net

Re: virtual server with subdomain

From: <glassfish_at_javadesktop.org>
Date: Tue, 18 Aug 2009 03:36:01 PDT

I made something like that but with the webgui tool to admin the server.

The easiest way is when creating the virtual server add the hosts you want to serve by the virtual server. In your case:

[i]Hosts: www.example.com, example.com[/i]

After that you have to choose the default web module you want to serve.

If you want example.com to be redirected to www.example.com the way to solve is to create a virtual server for the host www.example.com with the default web module you want to serve and another virtual server for the host example.com. In this one you have to add a property [i]redirect_n[/i] with the value:

[i]from=/ url-prefix=http://www.example.com[/i]

Hope it helps!
[Message sent by forum member 'kienvaser' (kienvaser)]

http://forums.java.net/jive/thread.jspa?messageID=360911