Redirect Http to Https C#

Umbraco and C#

This blog is in 3 parts and is based on a fictitious company that sells goods and allows visitors to add comments.

  1. The company needs all pages to be over https, so we need some way of achieving this.
  2. The items sold by the company need to have microdata tags to help visitors see the items for sale on search engines.
  3. Visitors can leave a comment, but before the comment can is shown, it needs to be viewed by a member of staff.

First, we need to create a new solution in Visual Studio with two projects called Web.UI and Web.Model and then add Umbraco and Archetype to both projects.

This example uses Umbraco version 7.5.10 and Archetype 1.13.2.

After all the NuGet packages have installed, rebuilt the project and run, as this is a new project you will see Umbraco's default page where you need to add your username and password.

Once you have entered your details, create a home page and items for sale page.

We now need to create the module that will force all pages to display with Https, using the code below.

Leave a comment