Only replace non-empty route parameters when building URL