added option (default true) to ignore ?query part of url