Infinite Loop When Using Relative URLs for Redirects or the Posting.URL Property (302182)



The information in this article 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 "/files/recent/headline.html".

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 (<NCOMPASSSTAGINGSERVER>...</NCOMPASSSTAGINGSERVER>) 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 <NCOMPASSSTAGINGSERVER>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,"<NCOMPASSSTAGINGSERVER>",""),"</ 

NCOMPASSSTAGINGSERVER>","")

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
				

Modification Type:MajorLast Reviewed:11/12/2001
Keywords:kbDSupport kbprb KB302182