views:

31

answers:

2

I have 2 domain: domain1.com and domain2.com

how can i know what is the domain that the user used to call a action?

like

domain1.com/controller/action

i want get domain1.com from the action

is possible?

thanks

+1  A: 

Hi,
this should be possible by looking at the request object, see chapter 9.1 in the Guide.

domain(n=2)     The hostname’s first n segments, starting from the right (the TLD).

Hope this helps.

jhwist
A: 

Use the host method. If you require the port as well, use host_with_port.

John Topley