short URL I have tried it both ways. that is without creating any sub-domain and any DNS for admin When I create the sub-domain admin for example.com and adding admin in dns A records for example.com I am getting the home page of example.com instead of being redirected to http://server1.example.com:8080 Please tell me what I am missing.
short URL Some Times not getting the full answer or hand-holding does help. I was successful after digging in and trying various options. I am putting it here, if it can help somebody out there. to achieve admin.example.com redirect to server1.example.com:8080 I tried various options like: Just putting the code provide earlier by Till in apache directive under option tab for website example.com Code: RewriteCond %{HTTP_HOST} ^admin.example.com [NC] RewriteRule ^/(.*) http://server1.example.com:8080/ [L,R] which was giving me error - page not found. Then I created subdomain admin in website options and also added A record for admin in DNS record for example.com. The result : I start getting the home page of example.com - no redirect. Finally I deleted the sub-domain created in website options, deleted the DNS entry admin in example.com. I also deleted the code inserted in apache directive. Than I created one new domain under :// domain option admin.example.com and created DNS records for admin.example.com. I also created website for admin.example.com and in redirect option I inserted the full path like http://server1.example.com:8080 and in redirect type I selected [R,L] and Presto - my-redirection was working perfectly. I also checked the vhost file admin.example.com, where the code was automatically inserted in /etc/apache2/sited-enabled/admin.example.com.vhost file similar to given by till Code: RewriteEngine on RewriteCond %{HTTP_HOST} ^admin.example.com [NC] RewriteRule ^/(.*)$ http://server1.example.com:8080/$1 [R,L] Yes there was one more problem I was facing that I was not able to access server1.example.com:8080 or even server1.example.com from other PC than server. Than I have added server1 to DNS record of example.com, which enable me to access the server1.example.com:8080 from anywhere. Hope this will help someone in same situation. Regards