handle subdirectories in the domain redirection code paths
Merge branch 'subdirectories'