Determine URL type more carefully