Closed loongmxbt closed 3 years ago
I use this caddyfile with Caddy V2, solves the problem, and if I have other better solutions will post here.
www.demo-site.com {
root * /var/www/xny-site-html/_site
encode gzip
file_server
redir / /zh-CN/ 302
}
Thanks for sharing @loongmxbt. Yep, I think the redirect would be the way to go
Hi, I've successfully serve a multi-language site locally with the plugin. But when I deploy
_site
to my server I've encountered some problems.For example there is
/en-US
and/zh-CN
under_site/
directory, and I want the root path/
redirect to/en-US
.In my first caddyfile, there is:
This can go to both /en-US and /zh-CN but cannot go to
/
because no index.html under_site
.If I change the caddy file into the following:
I can access to
www.demo-site.com/
by default, but cannot access the images and other static files.So I want to know is there a recommend way to deploy the static i18n site using caddy or nginx? Thanks in advance!