470,626 Members | 2,139 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,626 developers. It's quick & easy.

Issue with double redirect

Seb
Hi,

We have a page in VB.NET redirecting to an external site.

Example: http://mysite.com/redirect.aspx?url=...their-page.asp

The target page on the external site (http//externalsite.com/their-
page.asp in this example) also redirects to another page (let's say
"their-page2.asp") on their website).

When people click on my original link, Internet Explorer exhibits some
strange behaviour.

The first time, the IE address bar will show: http://mysite.com/their-page2.asp
(basically, staying on the original domain but trying to get the page
from the external site), resulting in a "page not found".

However, during subsequent attempts, IE sometimes gets it right, and
does redirect to "http//externalsite.com/their-page2.asp".

Can something be done on our aspx page to ensure that the redirect
works properly? Is this a defect with IE?

Thanks,
Seb

May 24 '07 #1
5 5276

Seb wrote:
Hi,

We have a page in VB.NET redirecting to an external site.

Example: http://mysite.com/redirect.aspx?url=...their-page.asp
If you want to pass a string containing slashes in the url as query
parameter you have to encode it.
Use HttpUtility.UrlEncode and HttpUtility.UrlDecode.
Regards,
Mykola
http://marss.co.ua

May 24 '07 #2
A problem with your redirect string as well is that you are missing a colon
: should be http://

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"marss" <ma******@gmail.comwrote in message
news:11**********************@q66g2000hsg.googlegr oups.com...
>
Seb wrote:
>Hi,

We have a page in VB.NET redirecting to an external site.

Example:
http://mysite.com/redirect.aspx?url=...their-page.asp

If you want to pass a string containing slashes in the url as query
parameter you have to encode it.
Use HttpUtility.UrlEncode and HttpUtility.UrlDecode.
Regards,
Mykola
http://marss.co.ua

May 24 '07 #3
Seb
Thanks,

the example was poorly constructed, but our pages have the proper
encoding and URLs as parameters, so it appears to be an issue with the
redirect itself. The same happens when the URL is actually hard-coded
within our redirect page.

David wrote:
A problem with your redirect string as well is that you are missing a colon
: should be http://

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"marss" <ma******@gmail.comwrote in message
news:11**********************@q66g2000hsg.googlegr oups.com...

Seb wrote:
Hi,

We have a page in VB.NET redirecting to an external site.

Example:
http://mysite.com/redirect.aspx?url=...their-page.asp
If you want to pass a string containing slashes in the url as query
parameter you have to encode it.
Use HttpUtility.UrlEncode and HttpUtility.UrlDecode.
Regards,
Mykola
http://marss.co.ua
May 24 '07 #4
without a sample of your redirect code, there is no way to figure out
what your code is doing wrong.

if the url will work in the browser (paste it in the address bar, then
it should work as a redirect.
-- bruce (sqlwork.com)

Seb wrote:
Thanks,

the example was poorly constructed, but our pages have the proper
encoding and URLs as parameters, so it appears to be an issue with the
redirect itself. The same happens when the URL is actually hard-coded
within our redirect page.

David wrote:
>A problem with your redirect string as well is that you are missing a colon
: should be http://

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"marss" <ma******@gmail.comwrote in message
news:11**********************@q66g2000hsg.googleg roups.com...
>>Seb wrote:
Hi,

We have a page in VB.NET redirecting to an external site.

Example:
http://mysite.com/redirect.aspx?url=...their-page.asp
If you want to pass a string containing slashes in the url as query
parameter you have to encode it.
Use HttpUtility.UrlEncode and HttpUtility.UrlDecode.
Regards,
Mykola
http://marss.co.ua
May 24 '07 #5
Seb
I have found some info more regarding this issue.

The external page the asp code is redirecting to is protected by NTLM,
so the first time, the user gets prompted his login/password, and the
redirect fails (the URL is appended to the current site).

The second time, the redirect works (as the user is already
authenticated).

Is there a solution to have a proper redirect to an external site/page
protected by NTLM works?

Thanks,
Seb

Seb wrote:
Thanks,

the example was poorly constructed, but our pages have the proper
encoding and URLs as parameters, so it appears to be an issue with the
redirect itself. The same happens when the URL is actually hard-coded
within our redirect page.

David wrote:
A problem with your redirect string as well is that you are missing a colon
: should be http://

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"marss" <ma******@gmail.comwrote in message
news:11**********************@q66g2000hsg.googlegr oups.com...
>
Seb wrote:
>Hi,
>>
>We have a page in VB.NET redirecting to an external site.
>>
>Example:
>http://mysite.com/redirect.aspx?url=...their-page.asp
>
If you want to pass a string containing slashes in the url as query
parameter you have to encode it.
Use HttpUtility.UrlEncode and HttpUtility.UrlDecode.
Regards,
Mykola
http://marss.co.ua
>
May 30 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by bagsmode | last post: by
4 posts views Thread by simon | last post: by
12 posts views Thread by Assaf | last post: by
6 posts views Thread by Mike | last post: by
5 posts views Thread by DougS | last post: by
reply views Thread by volcovcommander | last post: by
3 posts views Thread by James Thomas | last post: by
14 posts views Thread by n3o | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.