how to get port value from preFetch ssrContext



  • I want redirect the user to a specific domain if he is not using correct protocol
    for example:

    if (ssrContext.req.headers.host=='hexin-medical.net'||ssrContext.req.headers.host=='hexin-medical.com'){
            redirect('https://www.hexin-medical.net')
          }
    

    Thanks



  • Wouldn’t that be better on the server itself? So, redirects within the web server?

    Scott


Log in to reply