take jafar version of URL.php
fixing notFound and error page