skip to Main Content

I have a Next.js site, but for the Landing page I would use a WordPress site. How is it possible?

2

Answers


  1. Everything depends on the hosting server that you will use for hosting those website’s. You can use one domain for both but you might be forced to use different route’s.

    Example:

    Landing Page : www.example.com or www.example.com/home

    WordPress : www.example.com/news

    Using apache for hosting, you can define a .htaccess that would redirect to the right application depending on the route.
    I would suggest you to look into that, unless you can provide us more details about your hosting solution.

    Edit:
    You can check out the vercel configuration file to route something to specific subfolder/files.
    More info here: https://vercel.com/docs/configuration#project/redirects

    Login or Signup to reply.
  2. In the next.config.js, you can set rewrites to work like a proxy with specific application paths. If you want only NextJS homepage router to another domain homepage, you can do this:

    module.exports = {
      rewrites() {
        return [
          {
            source: "/",
            destination: "http://mywordpresssite.com/",
          },
        ];
      },
    };
    

    Docs

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search