add rewrite support. application can run with xcms,test compelete