Part 1:

HTTP_HOST replace with HTTP_X_HOST