title: How to redirect different sub domain requests to different port
body: <p>I have two applications, one is the <code>www.myexample.com</code>, another is the <code>blog.myexample.com</code>. I am using PHP and Apache.</p>
  
  <p>Now, I want to let <code>www.myexample.com</code> runs on port 82 of my machine, and <code>blog.myexample.com</code> on port 83, on the same machine. How to configure the apache and/ or the PHP scripts so that when the requests for the requests are served properly?</p>
  
  <p><strong>Edit: Thanks for everyone who responds, but I afraid I don't get the question clear-- my bad!</strong></p>
  
  <p><strong>What I really want is to simulate a condition whereby the www.myexample.com and blog.myexample.com are located on different machines. So when a request comes in, the gateway server ( the one which is also hosting www.myexample.com) will check whether this is a request for www.myexample.com or for blog.myexample.com and does the necessary reroutes.</strong></p>
  
  <p>How to do this? Thanks. </p>