Redirect Entire Domain with Flask

My blog used to be served from I recently decided to serve it from my “root” subdomain, but I wanted to keep all the old links working. This means that should redirect to and that every URL should redirect to its appropriate counterpart under the new domain - should point to

This is a companion discussion topic for the original entry at

Why are you not using a .htaccess file for this? This would be even simpler and does not require to setup a new application.