Fix handle error
Add url_rewrite support, make basename simply