Rework custom homepage routing.

Routes with query strings are now forced to work as redirects. The code
for working with the custom homepage is generally simplified also.