3

I have a .net C# page that redirects to an absolute url, eg:

Response.Redirect("rtsp://myvideoServer.com/myVideoAddress.mp4?ticket=1234&dt=1234");

But after the redirecting it results in:

"http://m.mysite.com/rtsp://myvideoServer.com/myVideoAddress.mp4?ticket=1234&dt=1234"

It works fine if I write the url to an HTML page and click the address. But the redirection does that mess.

The most weird is that it worked before last version.

Do you have any ideas? I'm almost doing a workaround to solve that.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
eric
  • 960
  • 10
  • 17

2 Answers2

5
Response.StatusCode = 301;
Response.AddHeader("location","rtsp://myvideoServer.com/myVideoAddress.mp4?ticket=1234&dt=1234");
Response.End();

EDIT is not working with browsers

I don't think a browser understands the rtsp protocol (in the meaning of doing e GET request in other way than from an embedded object), but if you have a client which understands this redirect, this should work.

Adrian Iftode
  • 15,465
  • 4
  • 48
  • 73
  • the problem is with rstp and how the browser deals with it paste this rtsp://myvideoServer.com/myVideoAddress.mp4?ticket=1234&dt=1234 in the browser's bar, how behaves? – Adrian Iftode Jul 04 '11 at 21:30
1

I would suggest doing a workaround.

Use Response.AddHeader instead. It looks like Response.Redirect isn't recognizing rtsp:// as a protocol, and is treating it as a relative path.

Response.AddHeader("Location","rtsp://myvideoServer.com/myVideoAddress.mp4?ticket=1234&dt=1234");
Kevin Stricker
  • 17,178
  • 5
  • 45
  • 71