-
I am migrating an existing website to Gatsby. In the example I write above, I parse the url params and use them in to customize the page. I would like to allow both How do I do that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you need to make redirect settings, you usually need to do that on your server. How to do that depends on the server / service you use. https://www.gatsbyjs.com/docs/how-to/cloud/working-with-redirects-and-rewrites/ It's not recommended to provide the same content with different urls. But if you really want, you need to call createPage({
path: `/invited`,
component,
context: {
...,
},
})
createPage({
path: `/invited.html`,
component,
context: {
...,
},
}) More detailed explanation is in the following page: |
Beta Was this translation helpful? Give feedback.
If you need to make redirect settings, you usually need to do that on your server. How to do that depends on the server / service you use.
createRedirect()
might help:https://www.gatsbyjs.com/docs/how-to/cloud/working-with-redirects-and-rewrites/
It's not recommended to provide the same content with different urls. But if you really want, you need to call
createPage()
for those urls like:More detailed explanation is in the following page:
https://www.gatsbyjs.com/docs/creating-and-modifying-pages/