Fixed url function to account for domainname in REQUEST_URI