More robust check for prev/next URLs