Make sure we search for url prefix only in format, not in filename (bug #3613)