Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jack Taylor 16 posts 107 karma points
    Mar 02, 2021 @ 18:35
    Jack Taylor
    0

    Hosting static HTML / JavaSript page in Umbraco Cloud

    Hello,

    Does anyone know how I can host a separate HTML page on my Umbraco cloud build?

    I'm currently stuck trying to workout how I can create a new folder on my Umbraco cloud site and host a third party video tour. The video tour is a index.html file with folder containing lots of images / JavaScript / XML files.

    I'd like it so I can host the files on my Umbraco project so I can keep it on the same domain, so the URL is https://mydomain.com/video-tour

    I've cloned my Umbraco cloud site locally and have added a /video-tour folder to the files at root level along side the App_code, scripts, Umbraco folders etc.

    In the folder I've put a basic index.html test file.

    Following this documentation (https://our.umbraco.com/documentation/Reference/Config/webconfig/), I've gone into the web config file and added the lines to mean Umbraco will ignore this folder and file:

    <add key="Umbraco.Core.ReservedUrls" value="~/video-tour/test.html" />
    <add key="Umbraco.Core.ReservedPaths" value="~/video-tour" />
    

    When I now go to the page (http://localhost:26966/video-tour/) I get the following error message: HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.

    Can anyone help me with the above? Or know how to host and load a HTML file so it loads on my domain at the file path?

    Thanks in advance

  • Alex Skrypnyk 6134 posts 23953 karma points MVP 8x admin c-trib
    Mar 03, 2021 @ 22:10
    Alex Skrypnyk
    100

    Hi Jack

    You need to add a rewrite rule that will let your server know - Show HTML file when "/video-tour" Url requested.

    In your case, IIS just tries to show to the user //video-tour folder - what is not allowed.

    You need Rewrite rule like this:

    <rule name=".html">
                <match ignoreCase="true" url="^/video-tour$"/>                
                <action type="Rewrite" url="{R:0}/video-tour/test.html"/>
            </rule>
    

    Thanks,

    Alex

  • apload-gmbh 37 posts 107 karma points
    Aug 11, 2022 @ 13:25
    apload-gmbh
    1

    And for U9 and U10?

    I tried in the appsettings.json according https://our.umbraco.com/Documentation/Reference/Configuration/GlobalSettings/

    ... "ReservedPaths": "~/template/," "ReservedUrls": "~/template/index.html," ...

    Do I need also I rewrite rule?

    If I open mydomain.ch/template/index.html error is Status Code: 404; Not Found. If I open mydomain.ch/template/ I see an Umbraco-404 Errorpage.

Please Sign in or register to post replies

Write your reply to:

Draft