better URL handling for libevent HTTP server