I am trying to embed a static SharePoint page (.aspx file) using the Embed webpart on a SharePoint online site. The file is added to the Share Documents directory of the same site.

The end goal is to host a static website inside an iFrame on the SharePoint site. This static website will have some HTML pages (with the extension changed to .aspx), images, CSS, and JS. I have achieved this goal in my previous organization on a Classic SharePoint site using the Page Viewer webpart.

However, my current organization is using modern SharePoint site and I want to achieve the same goal on the modern site. After referring to a few of the articles over the internet, I saw that the custom scripts need to be enabled for the site where I want to embed the aspx files. On my request the IT team has enabled the custom scripts, but still no luck in displaying the pages. The site is still showing the "File not found" error.

1 Answer 1


I would recommend using the modern communication site template. Using the native features of SharePoint will provide a better user experience than attempting to display your site via an iframe. You might want to checkout the SharePoint look book for an idea of what can be achieved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.