Create the right rewrite templates