set the proper hostname for ajax calls