title: Is it possible to redirect request from middleware in .net core
body: <p>What I'm trying to achieve is this:
  When someone visits: <code>smartphone.webshop.nl/home/index</code>
  I want to redirect this from middle ware to: <code>webshop.nl/smartphone/home/index</code></p>
  
  <p>I want to do this because I want to create a generic controller which get data from database based on <code>sub-domein</code>. So I need all the calls come to the same controller. </p>
  
  <p>This is my middleware now:</p>
  
  <pre><code>public Task Invoke(HttpContext context)
      {
          var subDomain = string.Empty;
  
          var host = context.Request.Host.Host;
  
          if (!string.IsNullOrWhiteSpace(host))
          {
              subDomain = host.Split('.')[0]; // Redirect to this subdomain
          }
  
          return this._next(context);
      }
  </code></pre>
  
  <p>How can I redirect and how should my <code>controller/mvc</code> config look like? </p>
  
  <p>I'm pretty new to .net core so please be clear in your answers. Thank you.</p>