Hostname in preview with C1 2.1.3+

Topics: General, Troubleshooting
Jun 28, 2011 at 9:08 PM
Edited Jun 28, 2011 at 9:30 PM

What is the proper way to query for the current hostname when previewing a page across hostname boundaries? I have this scenario

Two websites

  • Website A
  • Website B

Two hostname binding

  • websitea.local -> Website A
  • websiteb.local -> Website B

Now, when i access websitea.local/composite and choose a page in the other website and do a "view published" Composite correctly shows me http://websiteb.local/somepage in the "address bar" but if i print out the current hostname on the page it shows websitea.local. I assume some proxy handling behind the scene, but is there also a Composite API i can query to get the correct hostname when doing operations inside the console across hostnames?

Jun 30, 2011 at 11:53 AM

I provided @burningice with the necessary code. Also the related API may be changed until next release.