Andrew Simpson
Andrew Simpson

Reputation: 7314

How to force my asp.net core uses http and not https

I have seen this type of question asked but the other way. namely to redirect http to https.

This my scenario. I have a asp.net core app. I deploy it to my test server. When I view in an eternal browser the js and css etc will not load up. Upon inspection it is redirecting everything to https. I do not want this.

How can i force it to 'stay' with http?

Upvotes: 2

Views: 6493

Answers (2)

LazZiya
LazZiya

Reputation: 5719

Goto project properties --> Debug --> uncheck Enable SSL

enter image description here

One more hint:

remove the schema from the URL, so it will load the referenced scripts and css files according the client's URL (http or https)

<script src="//cdn.mysite.com/myscript.js" type="text/javascript"/>

Upvotes: 5

Alsein
Alsein

Reputation: 4765

just remove the app.UseHttpsRedirection(); in Configure method in Startup class.

And nothing would be via HTTPS unless explicitly requested.

Upvotes: 5

Related Questions