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
Recent comments
1 day 56 min ago
1 day 7 hours ago
1 day 11 hours ago
1 day 13 hours ago
1 day 21 hours ago
2 days 7 hours ago
2 days 7 hours ago
2 days 11 hours ago
2 days 15 hours ago
2 days 16 hours ago