So your website is running happily with Gatsby. However, like every digital product, it is bound to grow and evolve. One candidate for change that you probably don’t give much thought to is URL architecture.

A blog post that started out at a URL like http://yourdomain.com/website-speed may be redirected to http://yourdomain.com/blog/how-to-make-your-website-faster.

Another scenario that you may find yourself in is when your content attracts a large following, prompting you to offer a gated section for subscribers.

Once they land on your home page, they will be automatically taken to a private dashboard page. Meanwhile, unauthenticated users who land on that private route will be navigated to the home page with a log-in section. This is a very common design pattern in web apps.

How do we put that into implementation? Stick with me and by the end of this article, you’ll build a production-ready redirect workflow that you can plug into any Gatsby app you dream up.

#reactjs #react #javascript #gatsby

Page Redirect With Gatsby
1.20 GEEK