add middleware extension support
add ajax url rewrite