Pointing all directories to the root directory

I am learning Vue and am using it’s router-links for my pages. Basically, this means I want to serve all content from the root directory, no matter what directory the client is trying to hit (with the exception of /static).

For example, I want to have mysite.com and mysite.com/about to point to the same index.html in the root directory. Is there a convenient way to represent this in the caddyfile? I’m simply going about it by listing all of them like

mysite.com, mysite.com/about, mysite.com/help {
    // other caddy stuff
}

I think you’d want to use re-write (https://caddyserver.com/docs/rewrite).

1 Like

Specifically, something like this: Configuring Caddy to be used with a SPA (Angular2) - #4 by lbguilherme

1 Like

That was exactly what I was looking for! Thank you!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.