Some improvements

- My previous try/catch did not get all exceptions. This code does.
- $current_url is definde in one line
- Speaking URLs can now be used with cache cleaning: domain.tld/nice/url/?refresh=changeme 
- !is_404(); instead of strlen($html_of_page) > 5000