LAX_DEV
LAX_DEV

Reputation: 2271

Firebase redirect to same path name

How can I add a script or something similar in Firebase JSON file to redirect to a different domain but with the same path.

For example: my users are currently visiting mydomain.com/help/page_id_1

Here page_id_1 is dynamic id's.

I want to redirect to support.mydomain.com/help/page_id_1

Can I do this as a redirect in firebase.json file?

Upvotes: 1

Views: 352

Answers (1)

Michael Bleigh
Michael Bleigh

Reputation: 26313

Yep! It'd look like this:

{
  "hosting": {
    "redirects": [{
      "source": "/help/:page",
      "destination": "https://support.mydomain.com/help/:page",
      "type": 301
    }]
  }
}

Upvotes: 3

Related Questions