#Rewrite to a Wordpress blog

1 messages · Page 1 of 1 (latest)

finite kernel
#

I have successfull added a rewrite to my next.config that looks like this:

    return [
      {
        source: "/blog/:path*",
        destination: "https://9g6.dbb.myftpupload.com/:path*",
      },
    ];
  },```

it works fine locally, but when deployed i get a 400 error
fresh pulsarBOT
#

Hi @finite kernel. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The issue you're experiencing might be due to the configuration of your deployment environment or the server where your WordPress blog is hosted. The 400 error typically indicates a bad request, which means the server was unable to understand or process the request.

Unfortunately, the provided knowledge sources do not contain specific information about troubleshooting this issue in a deployment environment or with a WordPress blog.

However, here are a few general suggestions:

  1. Ensure that the destination server (in this case, your WordPress blog) is set up to handle the incoming rewrites correctly.
  2. If you're using trailingSlash: true, you also need to insert a trailing slash in the source parameter. If the destination server is also expecting a trailing slash it should be included in the destination parameter as well. source (https://nextjs.org/docs/app/api-reference/next-config-js/rewrites#rewriting-to-an-external-url)
  3. Check the logs of your deployment environment and your WordPress server for any error messages that could give you more information about the issue.

For more detailed help, you might want to refer to the Next.js and Vercel documentation, or the support resources for your deployment environment and WordPress.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: