Updated with hashbang URLs and port handling.