在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;

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
  • 2022-02-27
猜你喜欢
  • 2022-12-23
  • 2021-04-26
  • 2022-02-07
  • 2022-03-05
  • 2021-09-18
  • 2022-12-23
相关资源
相似解决方案