Solved

Hosting and redirect to https

Posted on 2013-05-16
3
473 Views
Last Modified: 2013-05-17
Hello experts,
I’ve run into an issue. I’ve developed an ASP.NET site with a Master Page structure for a client who already had hosting set up on 1and1. We needed to install an SSL cert. All works great EXCEPT when they try and reference the site without https://www.clientsite.com when the go to the old linky http://www.clientsite.com obviously nothing is found. Normally I’ve had access to the sever in which I could load Microsoft’s redirect module or use Go Daddy who has the module installed. Well as things would have it 1and1 is several decades behind in the server side technology and I’m struggling to find any way to redirect.
I’ve tried a couple different approaches including adding redirects such as these to both the master page and default page with  no luck:
If Not Request.Url.Scheme = "https" Then
     Response.Redirect("https://www. clientsite.com/Home")
End If

I contacted 1and1 and they sent me this:
http://help.1and1.com/domains-c36931/domain-administration-c79822/ssl-certificates-c39129/how-do-i-redirect-traffic-to-my-ssl-secured-site-a618201.html

I’m not sure I see the relevance as I’m using a master and that seems to reference .asp vs .aspx further I’ve done an almost identical scenario in the code above.

Any direction would be great.
0
Comment
Question by:thenrich
3 Comments
 
LVL 3

Expert Comment

by:DaveKeyes
ID: 39173975
This how I am doing that in a MVC web site, in the Home Controller module:

                if (Request.Url.Scheme != "https")
                    {
                    var baseUri = new Uri("https://" + Request.Url.Host);
                    var relUri = new Uri(Request.CurrentExecutionFilePath, UriKind.Relative);

                    return (Redirect(new Uri(baseUri, relUri).ToString()));
                    }
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39174408
They are asking you to create a default.asp file which is what IIS will try to serve on http. In the asp file, user will then be redirected to https. Try putting that code in a default.asp and placing in your root folder.
0
 
LVL 5

Author Closing Comment

by:thenrich
ID: 39174465
I ended up doing this plus adjusting the default page in my web.config
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now