Firebase redirect to same path name

一曲冷凌霜 提交于 2020-01-06 08:00:47

问题


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?


回答1:


Yep! It'd look like this:

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


来源:https://stackoverflow.com/questions/51544475/firebase-redirect-to-same-path-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!