Rewrite URL

Discussion in 'ASP.NET / ASP.NET Core' started by lethers, Feb 5, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. How can I rewrite an incoming request from:


    http://MyDomainName.com

    to:

    http://www.MyDomainName.com


    I'm asking this in response to a WCF service problem where I try to instantiate an object in JavaScript which is defined with a DataContract attribute in my C# server code. When the user enters www.MyDomainName.com there are no problems. But if the user enters MyDomainName.com without 'www' the instantiation fails. The support center at DiscountASP said this is because there can be only one address for a WCF endpoint. There was no further help as to how to solve this issue.

    Thanks for any help or guidance,
    Paul
     
  2. Hi,
    Use my Code coops below and you should find hundreds of code examples for this.
    btw, if you are on IIS7 here you can use the IIS7 rewrite, which you can watch a video on at www.iis.net
    Salute,
    Mark

    Technical Evangelist for DiscountASP.NET

    Find ASP.NET code samples with my Dev Coop search tools below.
    Google
    Microsoft

    DiscountASP.NET Technical Webcasts:
    http://www.iis7test.com/webcasts/

    My Microsoft Technical Blogs
    http://weblogs.asp.net/markwisecarver/
    http://blogs.windowsclient.net/wisecarver/default.aspx
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page