Escape URLs when grouping by domain

This caused some spectacular failure