Store routing option in history (type) and state (index)