You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as you can see, I have different routers that load a specific component based on the url.The basepath contains the language chosed by the user. This mechanism is working fine for the home page only, but for the other links doesn't work. Infact, if I visit something like:
http://localhost:3001/en/category-home/prod-foo
which must load the Collection component, the site simply redirect to:
http://localhost:3001/en
and display the Home component again.
Pages structure:
As you can see I have just the index.js which handle all requests as I configured in the gatby-node.js. If I remove the localization plugin, at least using this configuration:
{
resolve: `gatsby-plugin-intl`,
options: {
// Directory with the strings JSON
path: `${__dirname}/src/languages`,
// Supported languages
languages: ["it", "en", "ci", "fr"],
// Default site language
defaultLanguage: `it`,
// Redirects to `it` in the route `/`
//redirect: true,
// Redirect SEO component
redirectComponent: require.resolve(
`${__dirname}/src/components/redirect.js`
),
},
},
and I don't prefix the url with intl.locale, everything is working fine. But adding redirect: true in the plugin configuration, and prefixing the link with the locale, the site redirect me to the home component.
Removing redirect is working fine, but I lose the redirect of course
The text was updated successfully, but these errors were encountered:
I'm using Gatsby and I want build a single page site, so without create pages. For achieve this I edited gatsby-node.js with the following code:
in that case, each request is re-routed to the index.js page, which is the only one. Then, in the index.js page I have:
as you can see, I have different routers that load a specific component based on the url.The basepath contains the language chosed by the user. This mechanism is working fine for the home page only, but for the other links doesn't work. Infact, if I visit something like:
http://localhost:3001/en/category-home/prod-foo
which must load the Collection component, the site simply redirect to:
http://localhost:3001/en
and display the Home component again.
Pages structure:
As you can see I have just the index.js which handle all requests as I configured in the gatby-node.js. If I remove the localization plugin, at least using this configuration:
and I don't prefix the url with intl.locale, everything is working fine. But adding redirect: true in the plugin configuration, and prefixing the link with the locale, the site redirect me to the home component.
Removing redirect is working fine, but I lose the redirect of course
The text was updated successfully, but these errors were encountered: