added support for subdirectory sites