extend wsgi
rework rewrite