Originally in my config.rb I had the following:
activate :i18n, mount_at_root: false, langs: ['en-us', 'es-mx']
activate :directory_indexes
redirect 'index.html', to: 'en-us'
This works great for redirecting localhost:4567/
to localhost:4567/en-us
. However, I would actually like to redirect localhost:4567/
and localhost:4567/en-us
to localhost:4567/en-us/temporary-home-page
.
Changing my previous redirect in config.rb works fine:
redirect 'index.html', to: "en-us/temporary-home-page"
When I try adding the redirect for localhost:4567/en-us
, it doesn’t work:
redirect 'en-us/index.html', to: "en-us/temporary-home-page"
I still end up on localhost:4567/en-us
. I also tried each of the following combinations with the same result:
redirect 'en-us', to: "en-us/temporary-home-page"
redirect 'en-us/', to: "en-us/temporary-home-page"
redirect 'en-us/index.html', to: "en-us/temporary-home-page"
redirect '/en-us', to: "en-us/temporary-home-page"
redirect '/en-us/', to: "en-us/temporary-home-page"
redirect '/en-us/index.html', to: "en-us/temporary-home-page"
On some it would output this in the browser:
<html>
<head>
<link rel="canonical" href="en-us/temporary-home-page" />
<meta http-equiv=refresh content="0; url=en-us/temporary-home-page" />
<meta name="robots" content="noindex,follow" />
<meta http-equiv="cache-control" content="no-cache" />
</head>
<body>
</body>
</html>
What am I missing? How can I get the /
, /en-us
, and /en-us/
URLs to redirect to /en-us/temporary-home-page
?