Mapping a subfolder on a vercel deployment (404 deployment not found)

I would like to map example.com/test to mydeployment.example2.com (also example.com/test/* to mydeployment.example2.com/*)

example.com is managed on Cloudflare.
example2.com is managed on Vercel.

For example.com (Cloudflare), currently there is a rule (origin rules) like below

origin_rules = [
{
description = "prd"
enabled = true
expression = "(http.host eq \"www.example.com\" and starts_with(http.request.uri.path, \"/test/\"))"
action_parameters = {
sni = [{
value = "mydeployment.example2.com"
}]
origin = [{
host = "mydeployment.example2.com"
}]
}
}

This rewrite correctly on Vercel but there is something missing as i got a 404 deployment not found. any ideas ?

Hi there,

A 404 always comes from the origin.

Please take a look at this documentation that might serve the purpose you require:

Take care.

In that case, origin works perfectly (mydeployment.example2.com).

The error is not a typical 404, but this below

I’ve asked Vercel, it is not on their side but more on the rule that have been created on cloudlfare. I’ll try working with Workers

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.