Handle urls and direct js files correctly.