Jekyll: Redirect http to https
This Jekyll blog site is generated by committing to Azure Devops which builds and releases it as an Azure Blob Storage Static Web Site. Unlike Azure Static Web Apps, Azure Storage Static Web Sites do not have a TLS/SSL option. Azure CDNs are used with this site to get the site URL into
http://www.<customdomain> then into
https://<myname>.<customdomain>. It is desirable to serve up only through SSLs/TLSs and so redirect the
http Urls to
https. Normally it is simple to map
https://mydomain.com. But in this case there is the complication of mapping
<myname> as well.
On this site
davidjones.sportronics.com.au In the code below, this is
An .htaccess file was tried but this is an Apache server so it didn’t work. Also …
… was also tried. This worked on the development machine but not when deployed to Azure via Azure DevOps.
Added ability to stop redirection on a specific page by adding the
noredirect page property in the page’s FrontMatter. Value doesn’t matter. If that property exists the redirection doesn’t occur for that page. This is useful in development mode!
This code is included in the post page template and the index page and so all http are automatically redirected to https without any code needed in the post .md pages.
⭐ This works fine. No need for .htaccess file and minimal Jekyll Liquid code required, etc.⭐
|Next: >||Blazor Helpers App Members||1. Overview of adding a Members Table|
|This Category Links|
|Category:||Web Sites Index:||Web Sites|
|< Prev:||Azure Static Web Apps||General Availability May 12 2021|