Skip to content

Allow .html path and possibly redirect #38079

Answered by gh640
kickbk asked this question in Help
Discussion options

You must be logged in to vote

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:

createPage({
  path: `/invited`,
  component,
  context: {
    ...,
  },
})

createPage({
  path: `/invited.html`,
  component,
  context: {
    ...,
  },
})

More detailed explanation is in the following page:

https://www.gatsbyjs.com/docs/creating-and-modifying-pages/

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kickbk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants