title: Domain routing in Flask
body: <p>I wanted to redirect users from test1.domain.com to test2.domain.com. I tried 'host_matching' in url_map along with 'host' in url_rule. It doesn't seem to work, shows 404 error.For example, on visiting 'localhost.com:5000' it should go to 'test.localhost.com:5000'.</p>
  
  <pre><code>from flask import Flask, url_for, redirect
  app = Flask(__name__)
  app.url_map.host_matching = True
  
  @app.route("/")
  def hello1():
      #return "Hello @ example1!"
      return redirect(url_for('hello2'))
  
  @app.route("/test/", host="test.localhost.com:5000")
  def hello2():
      return "Hello @ test!"
  
  if __name__ == "__main__":
      app.run()
  </code></pre>
  
  <p>Is it possible? Has anyone tried?
  Thanks in advance..</p>