everything before rewrite server