Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 324
Andrew Simpson Avatar asked Apr 29 '26 06:04

Andrew Simpson


2 Answers

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

And nothing would be via HTTPS unless explicitly requested.

like image 64
Alsein Avatar answered May 02 '26 02:05

Alsein


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"/>
like image 23
LazZiya Avatar answered May 02 '26 01:05

LazZiya