added support for sites hosted in sub-directories