I have a new vps CentOS 5.3 with Webmin, BIND, Apache installed. I want install Shoucast 2 server on port 8000. Can i create subdomain (ex: radio.mystation.com) and redirect it to mystation.com:8000/radio (with Shoucast 2 stream path/id) ? How?

In others shared server, i can do that with my cPanel (Subdomain Manage Redirection).

test.yohang.net is currently being redirected to: http://yohang.net:8000/radio

When i open test.yohang.net (ex: Winamp), the player can stream.

link|improve this question
feedback

migrated from stackoverflow.com Dec 9 '11 at 1:07

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 0 down vote accepted

SHOUTcast is close enough to HTTP to allow for 301 and 302 redirects. You need something on a web server at http://radio.mystation.com that can send the appropriate redirect header.

Here is how you could easily do it with PHP:

header('Location: http://mystation.com:8000/radio');

PHP will automatically add the 302 status code for you. You can use 301 instead to make this "permanent", but be careful, as it is possible for this to cached, and you won't ever be able to change it.

To do a permanent redirect, put this above the prior line:

header("HTTP/1.1 301 Moved Permanently"); 
link|improve this answer
Thank you. It's worked. :) – Yoga Hanggara Dec 9 '11 at 13:21
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.