refactored to set base paths if domain 'localhost'