Reputation: 566
I'm currently working on a ASP.NET WebSite Security Project in School.
My objective is to start up my website with the URL of HTTPS, securing it with SSL.
I have been researching high and low over the net for guidance on how to properly enable SSL.
I'm using VISUAL STUDIO 2015 , and i have seen that the project properties can automatically enable SSL and then create a self-signed certificate.
I have actually gotten my website to be running at a URL - https://localhost:443/Example.aspx
It worked.. Then i played around with it here and there and i realised it requires VS 2015 to be run as administrator for it to work..
But i'm not sure if i'm setting up the SSL properly..
My queries are actually..
For query 2, i have actually researched, and many stated that, right clicking on my project then Property Pages -> Start Options -> Configure from there.
But this is actually what i get..
I tried playing around with the Start URL but it doesn't work at all.. I think maybe IIS is preventing it from working.. And i know there must be of something that i'm doing wrongly.. And i compared the Property Pages window and it's different from what i see from others..
Query 3,
These are the codes i used for my Web.Config file.
<system.webServer>
<!--<modules runAllManagedModulesForAllRequests="true" >
<remove name="UrlRoutingModule"/>
</modules>-->
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
</system.webServer>
Inside my applicationhost.config file
<site name="FinancialHub" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\Dom\Documents\Visual Studio 2015\WebSites\FinancialHub" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:6868:localhost" />
<binding protocol="https" bindingInformation="*:443:localhost" />
</bindings>
</site>
Might have more queries along the way.. All i can think of now is the foundation and fundamentals which i have done wrongly i presume..
Everything is messy.. I sincerely apologise.. I tried my best to search for what i can but to no avail..
Really appreciate any procedural help..
Upvotes: 0
Views: 659
Reputation: 15
In Web.Config:
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to https" enabled="True">
<match url="(.*)"/>
<conditions>
<add input="{HTTPS}" pattern="Off"/>
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}"/>
</rule>
</rules>
</rewrite>
</system.webServer>
Upvotes: 0