# Serving a simple static html file from inside elm-spa

**URL:** <https://discourse.elm-lang.org/t/serving-a-simple-static-html-file-from-inside-elm-spa/7950>\
**Category:** Learn\
**Created:** [November 29, 2021, 9:50pm UTC](https://discourse.elm-lang.org/t/serving-a-simple-static-html-file-from-inside-elm-spa/7950 "2021-11-29T21:50:28Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![RyanNHG](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ryannhg/32/5162_2.png) [@RyanNHG](https://discourse.elm-lang.org/u/RyanNHG)\
**Post date:** [November 30, 2021, 3:13am UTC](https://discourse.elm-lang.org/t/serving-a-simple-static-html-file-from-inside-elm-spa/7950/3 "2021-11-30T03:13:51Z")

</div>

Hey @madsh,

How you serve static pages in elm-spa will depend on what hosting looks like for you.

For single page apps, there is a requirement to redirect all requests to the single `index.html` file. For example, when I was making [https://elm-spa.dev](https://elm-spa.dev), I chose to host the app with Netlify.

Here’s what my `netlify.toml` file looked like to handle single-page redirects:

> <https://github.com/ryannhg/elm-spa/blob/main/docs/netlify.toml>

The last `[[redirects]]` section takes all page requests and points them to `index.html` (which serves the elm-spa application). This is what makes URL requests to `/posts` or `/about-me` always hit the elm-spa application.

If you were using Netlify, and wanted requests to `/innerspa/*` to go to a different entrypoint- you would specify a section like this before the final `index.html` redirect:

```auto
[[redirects]]
  from = "/innerspa/*"
  to = "/innerspa.html"
  status = 200

```

As long as your `innerspa.html` file is alongside `index.html` in the `public` folder, you should be all set.

If you are using a different server than Netlify, you’ll need to look into the docs for that hosting solution. The good news is this is a general frontend web app problem, so what you learn there will apply to elm-spa and any other frontend project you use. 🕶

**Hope this context helps!**  
Ryan

---

_[View the full topic](https://discourse.elm-lang.org/t/serving-a-simple-static-html-file-from-inside-elm-spa/7950)._
