Internal rewrites resolved internally?

Hello! :wave:

I have a questions to which I haven’t been able to find the answer in the docs.
If I have a rewrite, say, from:

Will vercel resolve these internally, or will it make an HTTP request to itself, similar to what it would do for /uk → my-site-elsewhere.com/about?

Thank you!

Hey, @arturfortunato! Welcome to the Vercel Community :smile:

That’s an excellent question about Vercel’s rewrite functionality!

For rewrites within the same project (like /about/uk/about), Vercel resolves these internally without making an additional HTTP request.

For rewrites to another project in the same Vercel account (like /aboutanother-project-in-my-account.com/about), Vercel doesn’t have a built-in mechanism to directly rewrite to another project within the same account without making an HTTP request. These rewrites are treated similarly to external rewrites.

For external rewrites (like /ukmy-site-elsewhere.com/about), Vercel will indeed make an HTTP request to the specified destination.

It’s important to note that while Vercel supports using rewrites as a reverse proxy, including to external destinations, there isn’t a special internal routing mechanism for cross-project rewrites within the same account.

If you need to frequently route between different projects in your Vercel account, you might want to consider alternative architectures, such as using a monorepo setup or implementing a custom routing layer.

A helpful guide:

Let us know how you get on!

Great, that makes sense.
Thank you!

1 Like