parse url: Improvements for detecting the page type