How to host a static HTML site on SharePoint

If you have a static HTML site that needs to be shared internally inside your organization, you don’t need to get a dedicated hosting service to do it

SharePoint can be used to host the static HTML sites if you follow the 5 simple steps described in this article.

  1. Rename all your .html files to .aspx and make sure all the links in the site are correct
  2. Open the SharePoint site using SharePoint designer
  3. Open the Site Pages or Pages library
  4. Copy all your files to the library
  5. Select the home page of your static site and click on Set as Home Page


20 Responses to “How to host a static HTML site on SharePoint”

  1. Dave

    June 13, 2019

    is this only good for On-Premise and cannot be done with O365 SharePoint Online? We are a higher ed using SP Online.

    Thank you

    Reply
    • João Ferreira

      June 13, 2019

      Hi Dave,

      This works for Online also. I actually built the article and tested it on SharePoint Online.

      Reply
      • Dave

        June 13, 2019

        Thank you. I will try it… what version of Designer did you use? I want to replicate it

        Reply
  2. Jeff Angama

    June 24, 2019

    Hello,

    Yes it is working, but is it recommended and supported in future by microsoft ?
    I’ve some customer using this way to host html page in SharePoint Online,

    Thank you,

    Jeff

    Reply
    • João Ferreira

      June 24, 2019

      Hi Jeff,

      I think this will always be supported by Microsoft, in reality you are just showing another aspx page like SharePoint does.

      Thank you,

      João

      Reply
  3. Ingo

    July 11, 2019

    YOU made my day………….!!!!!!!!!!!!!!!!!!!!!!

    Reply
  4. Victor

    July 19, 2019

    I love it… what about associated CSS, JS files, etc?

    Reply
    • João Ferreira

      July 19, 2019

      Hi Vitor,

      You can host them on the same folder or on the style library and then modify the path to the files in the HTML.

      Reply
  5. Victor

    July 25, 2019

    I did not rename the html files to aspx and then add them to my library.

    I actually added to my shared Documents Library, accessed this in Sharepoint Designer, and renamed the files to aspx there. This actually updates all other files to point to this changed file, so there was no need to worry about checking the files themselves. Saved a lot of time.

    Reply
    • João Ferreira

      August 9, 2019

      Hi Victor,

      Thanks for your feedback, really appreciate it.

      Reply
  6. Gary

    September 12, 2019

    Microsoft then say that one should Enable Modern Authentication for Office 2013 on Windows Devices.

    See https://docs.microsoft.com/en-gb/office365/admin/security-and-compliance/enable-modern-authentication?redirectSourcePath=%2Farticle%2FEnable-Modern-Authentication-for-Office-2013-on-Windows-devices-7dc1c01a-090f-4971-9677-f1b192d6c910&view=o365-worldwide

    But the registry keys did not exist in my Windows 10 installation

    After this you should be able to connect to the site with SharePoint Design Manager and upload files. But if you can’t upload an .aspx or change the file name to an .aspx but instead get an error message that “You no have Permission to do this Operation” you will need to change the permissions on the site to include Customise Pages.

    (to be continued)

    Reply
  7. Gary

    September 12, 2019

    To allow Customisation of Pages with SharePoint Design Manager

    To check that you haven’t got this permission go to your SharePoint Site and from the Home Page hit the cog in the top rhs corner for Settings then Site permissions. Then Advanced Permission Settings. Then Check Permissions for the Top Menu. Put in your user name and most likely you will see Deny for Customise Pages.

    For reasons best known to Microsoft these are turned off by default even for users with “Full Control” and despite their documentation saying that this isn’t the case.

    You can in theory change them in the Office 365 SharePoint Admin Centre. You will need to log onto the normal Office 365 Admin Centre at https://www.microsoft.com/en-us/microsoft-365/business/office-365-administration with Sign in Now

    Then make sure that you aren’t using the bonkers New Admin Centre but the old version. Go to … Show All (to actually display the menu items!!!) then under Admin Centers find the SharePoint Admin then Settings and Turn on “Allow users to run custom script on personal sites” and ” Allow users to run custom script on self-service created sites”.

    You are then expected to wait up to 24 hours to proceed – but even after 48 hours it hadn’t worked for me – so I think that Microsoft’s Admin software is broken.

    The way to actually change them is by downloading SharePoint Online Management Shell.

    Then type in

    Connect-SPOService

    If your SharePoint site is say
    https://mydomain.sharepoint.com/sites/mysharepointname
    then the url that you need to connect to is

    https://mydomain-admin.sharepoint.com/

    (note the “-admin”)

    and then you will need to log in with your Microsoft Account.

    Then you can set the customise pages permission for your sharepoint site by
    Set-SPOsite https://mydomain.sharepoint.com/sites/mysharepointname -DenyAddAndCustomizePages 0
    for a Team site.
    Again it appears that the Microsoft documentation that you will find on the web is wrong as it suggests that you use the ie to my understanding the domain or tenant name rather than the SharePoint url. Apparently using the domain url works for non Team sites.

    (There is another alternative way using “Set-SPOSite -Identity https://mydomain -DenyAddAndCustomizePages $false” but this didn’t work for me – but apparently will do will the sharepoint url – see https://www.qdoscc.com/blog/sharepoint-o365-permissions-deny-add-and-customise-pages-issue
    and Tom’s comments.

    If you have done this correctly then when you check your user’s permissions you won’t have the Deny Customize pages.

    Then you will be able to use Joao’s method at the start of this page.

    If it is worth all this bother is another question. All I wanted to do was to share a HTML link with our oursourced Help Desk Provider and didn’t want it to be published on our website. SharePoint seemed like a good solution – but boy I am not impressed with it. I regard myself as fairly IT literate although I am not an IT specialist but surely Microsoft should have built in this functionality into the menu structure.

    Reply
    • João Ferreira

      September 12, 2019

      Hi Gary,

      Thanks for your feedback and detailed explanation, this method used to work like a charm when the custom scripts were enabled by default on SharePoint online.

      Quick tip for you if you ever need to activate the custom scripts again. Any site collection created after the the activation of custom scripts on the old admin center comes with all the options enabled you don’t need to wait the 24/48 hours to get them propagated to the entire tenant.

      Reply
    • Sarah

      August 3, 2020

      Thank you!!! Any idea as to how to make a page public? I just want to have one public page so that I can embed it via hidden iframe into another website, and a Flow will periodically update some content in it.

      Reply
      • João Ferreira

        August 4, 2020

        Hi Sarah,

        What you want to do will only work with SharePoint On-Prem, the instructions to make a site public can be found in this video
        Before doing it please make sure you will not be exposing any sensitive data that you may have in the site.

        Hope it helps, have a nice day 🙂

        Reply
  8. Gary

    September 13, 2019

    Um!! I think Microsoft, bless their little cotton socks, have been making changes.

    I had to alter the settings again this morning to allow Customise Pages permissions using Online Management Shell. I am guessing that Microsoft have a batch process which runs every twenty four hours and ignores the settings in their Admin screen but sets it to a Default setting of Deny Customised Pages.

    Maybe this is region specific, I am in the UK.

    But I also have have had exactly the same issue with a Communications site that I have created

    Reply
    • João Ferreira

      September 13, 2019

      Out of curiosity is your tenant on the standard release?

      Reply
  9. Gary

    September 13, 2019

    But you are right – your method is fantastic and easy once the permissions allow it.

    Reply

Leave a Reply


Web developer focused on SharePoint branding, blogger, tech enthusiast. Travelling and sports are my addictions, knowledge and success are my daily motivations.