Use site_url() instead of SERVER_NAME.