I am trying to write an ISAPI filter to redirect all traffic to
oanother URL, but I kept getting a strange error message from IIS:
in the OnPreprocHeader, I simply set the header to contain the
redirectedURL and return the SF_STATUS_REQ_NEXT_NOTIFICATION. However,
I kept getting this error message:
HTTP 414 - Request - URI Too Long
See the code snipplet below:
-----------
DWORD COutageRedirectorFilter::OnPreprocHeaders(CHttpFilterContext*
pCtxt,
PHTTP_FILTER_PREPROC_HEADERS pHeaderInfo)
{
char * redirectURL = "http://www.microsoft.com.au";
pHeaderInfo->SetHeader(pCtxt->m_pFC, "url", redirectUrl);
//we want to leave this alone and let IIS handle it.
// return this status code if not redirection is required.
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
What could be the problem? What is the right way to do a redirection?
Thanks
Your ISAPI Filter code definitely has problems, but let's first determine
what the filter *should* be doing, then worry about how it is implemented in
code.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Joe Bloggs" <es...@rocketmail.com> wrote in message
news:1155710096.9...@p79g2000cwp.googlegroups.com...
I have read your blog, what I needed to do is essentially doing is
using an ISAPI Filter to perform a server side redirection, in which
case, I believe is to set the request Header "url" variable.
Can you kindly show me in code how this can be done. Thanks.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Joe Bloggs" <es...@rocketmail.com> wrote in message
news:1155716386.1...@h48g2000cwc.googlegroups.com...