added support for page subdirectories