Multiple domains and BaseURL

Hi,

This has probably been asked before but i'm unable to find it or
figure it out.

I need to have multiple subdomains pointing to the same application.
Effectively making the BaseURL parameter a session variable and not
application?

Any ideas? I'm probably missing something right in front of me.

cheers,

Bill

Why not use a cgi variable?

My concern is over what CB does in order to resolve the BaseURL
parameter?

So when using event.buildLink() for example? I'd need it to use the
cgi variable.

My question is what's the best way to accomplish this?

So to explain in a bit clearer fashion:

2 domains

1) www.domain.com.au
2) www2.domain.com.au

I want the application to handle them both (treat them as the same
site) and use them accordingly everywhere based on the request.

You can look in forgebox we have an interceptor for this.

Luis F. Majano
President
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Yes, essentially the interceptor sets the base URL in the event object at the beginning of each request. Then build link automatically uses that. That way the value is set for each request based on the current cgi variable.

http://coldbox.org/forgebox/view/Multi-Domain-SES

Thanks!

~Brad

Oh great!

Thanks for the replies all :slight_smile:

This interceptor is essentially the same thing that I came up with to solve this issue however now I have an onRequestCapture interceptor which I am using to perform some redirects (want to be as close to the beginning of the request as possible) and the baseUrl has not yet been updated for the request. Is there any particular reason you chose to perform this intercept preProcess instead of onRequestCapture? I just want to make sure I am not going to run into unforeseen issues. Or maybe I am doing my redirects incorrectly. We want the redirects to be as fast as possible (super low latency).