Issue #2805657 by hussainweb: Layout generator does not work properly when site is in a sub-directory