Solved

Hosting and redirect to https

Posted on 2013-05-16
3
485 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

740 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