https not working with www.sitename.com

I just installed a security certificate for a website. It works fine with or without www if you use "https" and it redirects fine without https if you type in sitename.com, but if you type in www.sitename.com it shows the IIS 7 page.

It's a vb.net web app, currently, in page load I have

If Not Request.IsSecureConnection Then
                    Dim redirectUrl As String
                    redirectUrl = Request.Url.ToString().Replace("http:", "https:")
                    Response.Redirect(redirectUrl)
                End If

Open in new window


and in global.asax.vb I have

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires at the beginning of each request
        If HttpContext.Current.Request.IsSecureConnection.Equals(False) Then

            Response.Redirect(("https://" & Request.ServerVariables("HTTP_HOST")) + HttpContext.Current.Request.RawUrl)

        End If
    End Sub

Open in new window


but, still the issue/

Thanks in advance for helping.
PensarcAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve BinkCommented:
You have another site configured to pick up that domain.  Find it and disable it.
0
PensarcAuthor Commented:
I feel a little silly as it was a simple typo in the site bindings in IIS. Problem solved, thanks
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PensarcAuthor Commented:
Solved my own issue, was a simple typo in site bindings.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.