Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to host static html page on SharePoint online

We have a simple HTML page with some embedded JS. We used to host the pages with the .aspx extension on the on-premises SharePoint where you can click on the file and it opens like a regular page. When doing so on an online version of SharePoint it turns out that instead of opening a page it downloads it. I tried to use SharePoint designer to point it to the page but no luck, also I tried to embed the page with the embedded plugin on SharePoint but it is very limited in usage (no scripts, no header with the stylesheet, etc).

So the question is how to make an online version of SharePoint to open HTML files as a regular HTML and display its content instead of downloading the pages?

like image 528
Vladyslav Chaikovskyi Avatar asked Oct 23 '25 15:10

Vladyslav Chaikovskyi


1 Answers

We've found the odd behavior of SharePoint in conjunction with OneDrive. It turns out that when you upload your HTML files (with changed extension to .aspx) into someone's shared OneDrive or SharePoint folder directly - it will just download the pages.

But if you first upload your files into your own OneDrive and then copy/move the content to the shared folder or SharePoint's folder - it starts to open the page as it would behave in the on-premises version of SharePoint.

So the solution is to upload files directly into your own OneDrive and then copy/move the files to SharePoint's folder.

like image 151
Vladyslav Chaikovskyi Avatar answered Oct 25 '25 20:10

Vladyslav Chaikovskyi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!