简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM