Detect URL and path