Hello guys,
If you want to domain or subdomain to be forwarded to the different port for different service then this post will help you. Follow the following instructions.
There are two ways to do this. You could use the VirtualHost section of your httpd.conf or you could do it in your .htaccess file.
In httpd.conf:
Quote<VirtualHost *:80>
ServerName subdomain.mydomain.com
redirect / http://mydomain.com:4040/
</VirtualHost>
In .htaccess: Set redirect rule
QuoteRewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain\.mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://mydomain.com:4040/$1 [R=301]
Enjoy !!!