Fix for static path parsing

When a url contains a query parameter it gets incorrectly parsed
when replacing the /static portion.

This fix handles urls with query parameters.