How to redirect with “www” URL's to without “www” URL's or vice-versa?

后端 未结 8 2054
死守一世寂寞
死守一世寂寞 2020-12-08 05:15

I am using ASP.NET 2.0 C#. I want to redirect all request for my web app with \"www\" to without \"www\"

www.example.com to example.com

Or

example.co

8条回答
  •  轮回少年
    2020-12-08 06:03

    This version will:

    1. Maintain the http/https of the incoming request.
    2. Support various hosts in case you need that (e.g. a multi-tenant app that differentiates tenant by domain).

    
      
      
        
        
      
      
    
    

提交回复
热议问题