Microsoft KB Archive/302182

= Infinite Loop When Using Relative URLs for Redirects or the Posting.URL Property =

Article ID: 302182

Article Last Modified on 11/12/2001

-

APPLIES TO


 * NCompass Resolution 4.0

-



This article was previously published under Q302182



SYMPTOMS
On a Microsoft Windows NT 4.0-, a Microsoft Windows 2000 Server-, or a Microsoft Windows 2000 Advanced Server-based computer, you experience an infinite loop when you use relative URLs for redirects or the Posting.URL property.



RESOLUTION
If you use Response.Redirect to redirect browsers, do not specify a relative URL. Instead, specify the full path, such as &quot;/files/recent/headline.html&quot;.

Redirecting to relative URLs will lock the Site Stager in an infinite loop. If redirecting to URLs returned by Resolution properties, such as Posting.URL, you must manually modify the URL before redirecting to it. This is necessary because in the Staging Autosession mode, Resolution 4.0 wraps staging tags (...) around all URLs that it generates.

The files included with the Resolution server include a VBScript function to strip off staging tags. The StripOffStagingTags function in the Server/httpexec/shared/TemplateSwitching.inc file can be used to make generated URLs compatible with Redirects. The following example shows how to do this: 'Removes tags from urls.These tags appear

'in staging mode.This function is most commonly used to remove

'staging tags from redirection URLs in Staging mode.

'(this function is from the intranet_common.inc file)

Function StripOffStagingTags(strUrl)

StripOffStagingTags =Replace(Replace(strUrl,&quot;&quot;,&quot;&quot;),&quot;&quot;,&quot;&quot;)

End Function

'check mode -if Autosession.IsModeStaging is true,you must

'modify header response redirects in the following manner:

If Autosession.IsModeStaging Then

Dim pPosting

Dim strURLWithStagingTags

Dim strURLNoStagingTags

'set pPosting to the posting you want to redirect to

'...

'get URL -in Autosession staging mode,generated

'URLs are wrapped in staging tags

strURLWithStagingTags =pPosting.URL

strURLNoStagingTags =StripOffStagingTags(strURLWithStagingTags)

'redirect to cleaned-up URL

Call Response.Redirect(strURLNoStagingTags)

End If

Keywords: kbprb KB302182

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.