question

SSRS-VS avatar image
0 Votes"
SSRS-VS asked ZhiLv-MSFT answered

How to change ap-mvc project protocol from https to http

By default, the url of the views in a visual studio project are https. How can I change the whole urls of my project to http?

dotnet-aspnet-generaldotnet-aspnet-core-mvc
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HTTPS is a host configuration.

If this is an ASP.NET Core application then remove the app.UseHttpsRedirection(); line from the startup.cs file. You can also create a new project without HTTPS support to see what the template code looks like.

If this is an ASP.NET application then just change the project properties "Enable SSL" to false in Visual Studio. This only affect the development machine. You still need to update the host bindings.

0 Votes 0 ·

1 Answer

ZhiLv-MSFT avatar image
0 Votes"
ZhiLv-MSFT answered

Hi @SSRS-VS,

Based on your description and the tag, I assume your application is an Asp.net Core MVC application, right?

If that is the case, to make the application using Http, instead of Https, you could use the following methods:

  1. You can opt-out of HTTPS/HSTS when the app is created from the template.

    Unchecked the "Configure for Https" option:

    123205-image.png

  2. Open the launchSettings.json file and change the sslPort attribute to 0.

    123196-image.png

    In the startup.cs file, remove the app.UseHttpsRedirection(); from the Configure method.

  3. Open the project's Properties page, in the Debug panel, unchecked the Enable SSL option.

    123128-image.png

    By using this method, if you check the launchSettings.json file, you can see the sslPort attribute is changed to 0.

More detail information, see Enforce HTTPS in ASP.NET Core.

The above methods applys to Asp.net core Application, if you have any question about my reply, please let me know freely.


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Best regards,
Dillion




image.png (64.7 KiB)
image.png (85.2 KiB)
image.png (84.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.