How to make a route in a Next.js app to return content from a different domain

24 Views Asked by At

For example, assume I have a Next.js app with the following routes:

  1. www.mydomain.com/
  2. www.mydomain.com/route1
  3. www.mydomain.com/route2

Now if I try to navigate to www.mydomain.com/route3, Next.js will return a 404 error and the default "404 | This page could not be found" screen will be shown. Instead of this happening, I want to pull content (html/css/js) from another domain, e.g. www.otherDomain.com and show that on www.mydomain.com/route3.

Is this possible without iFraming www.otherDomain.com?

0

There are 0 best solutions below