Part 2:

SERVER_NAME replaced with HTTP_X_HOST and the Dual URL format fix
applied. AjaXplorer now generates share URL based on the HTTP_X_HOST.