diff --git a/packages/adapter-static/README.md b/packages/adapter-static/README.md index 540239ae8dba..8da5c9dbfa8f 100644 --- a/packages/adapter-static/README.md +++ b/packages/adapter-static/README.md @@ -138,6 +138,21 @@ You can also add turn off prerendering only to parts of your app, if you want ot During development, SvelteKit will still attempt to server-side render your routes. This means accessing things that are only available in the browser (such as the `window` object) will result in errors, even though this would be valid in the output app. To align the behavior of SvelteKit's dev mode with your SPA, you can [add `export const ssr = false` to your root `+layout`](https://kit.svelte.dev/docs/page-options#ssr). You can also add this option only to parts of your app, if you want other parts to be prerendered. +### Apache + +To run an SPA on [Apache](https://httpd.apache.org/), you should add a `static/.htaccess` file to route requests to the fallback page: + +``` + + RewriteEngine On + RewriteBase / + RewriteRule ^200\.html$ - [L] + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule . /200.html [L] + +``` + ## GitHub Pages When building for GitHub Pages, make sure to update [`paths.base`](https://kit.svelte.dev/docs/configuration#paths) to match your repo name, since the site will be served from rather than from the root.