Dinos Papoulias
Dinos Papoulias

Reputation: 13

firebase.json redirect from one domain to another with the same page after /

I want to redirect from thisdomain.com/webpage to thatdomain.com/webpage

I've tried using these globs for the source match:

/*
/**
*
**

This is my current firebase.json:

 {
    "hosting": {
    "public":".",
    // Add the "rewrites" section within "hosting"
        "rewrites": [ {
            "source": "/**",
            "destination": "https://thisdomain.com/**"
        } ]
     }
}

I want someone who goes to thatdomain.com/webpage to be redirected to thisdomain.com/webpage.

Upvotes: 1

Views: 1698

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598817

Rewrites are used within a site, they do not rewrite across multiple sites.

If you mapped both domains to the Firebase Hosting project as custom domains, then no additional setup should be required. You do need to map each domain/target to the public directory though. See https://firebase.google.com/docs/hosting/multisites#define_hosting_config

Upvotes: 1

Related Questions