fixed a error when uses a root domain and subdomians. When use domain like demo.com with a  home website and services.demo.com the regex pattern resolve the root domain demo.com when uses http://services.demo.com.