add url_replace test, fix url_replace
unfix ugly case
add some tests for url_replace