Fixed #21795 -- Made add_preserved_filters account for url prefixes.