Forum Moderators: phranque

Message Too Old, No Replies

port redirect

         

duncan320

6:31 pm on Aug 18, 2015 (gmt 0)

10+ Year Member



Hi All,
Is there a way in the .htaccess to redirect traffic to another port when people access a certain url.

The issue is that we have a radio stream and we have moved provider and this now runs on another port and lots of apps etc are configured to the old url.

lets say

stream1.example.com:1234 was the old host
stream1.example.com:4321 is what we now need it to be

How can I do this ?

Many Thanks

lucy24

8:11 pm on Aug 18, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sounds like a RewriteRule with accompanying RewriteCond looking at %{REMOTE_PORT} should do it.

That's assuming you really did mean "redirect" i.e. send back a message to the browser (or other UA) saying "We've moved!"

duncan320

8:28 pm on Aug 18, 2015 (gmt 0)

10+ Year Member



Sorry, a forward, as this points to apps on phones if its wrong it wont load so a forward (or redirect from this URL to the other with no message)

lucy24

12:19 am on Aug 19, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Oh, wait, I forgot one crucial question, since port numbers are involved. Is the new host even listening on port 1234? (I assume you made up the numbers so I won't look up the details.) If they're not listening in the first place, there is absolutely nothing you can do, because the request will never reach your htaccess.