base rewrite