proper location rewrite