IIS 重定向页面

在iis中执行的重定向方法:

Code:     

 CHAR szRedirect [256];
      // replace www.microsoft.com with desired server
      sprintf(szRedirect, "Location: http://%s/r/n/r/n", "www.microsoft.com");
      pCtxt->ServerSupportFunction ( SF_REQ_SEND_RESPONSE_HEADER,
            (LPVOID) "302 Redirect",
            (DWORD *) szRedirect,
            0 );
      // we are done with this request
      return SF_STATUS_REQ_FINISHED_KEEP_CONN;

注: 如果要定位到本地页面, 可能造成死循环, 可以加个判断, 判断当前页面是否为要重定向的页面, 是就跳过跳转, 不是进入跳转方法。

posted @ 2008-04-11 15:35  摇滚的石头  阅读(257)  评论(0)    收藏  举报