如何在Firebase中实现此.htaccess? [英] How to implement this .htaccess in firebase?

查看:40
本文介绍了如何在Firebase中实现此.htaccess?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我具有用于PWA的.htaccess

I have this .htaccess for a PWA

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

我想将应用程序迁移到Firebase,基本上它是说我共享了此链接

I want to migrate the app to firebase, basically what it does is let's say I shared this link

example.com/pwa/giftLink

他被重定向到PWA

example.com/pwa

PWA将他重定向到 giftLink .我不想通过代码来实现,我更喜欢通过 firebase.json

And the PWA redirects him to giftLink. I don't want to do it via code, I prefer doing it via firebase.json

推荐答案

在Firebase托管中

In Firebase Hosting rewrites, the equivalent would be:

"hosting": {
  // ...

  // Add the "rewrites" attribute within "hosting"
  "rewrites": [ {
    "source": "/pwa{,/**}",
    "destination": "/pwa/index.html"
  } ]
}

这篇关于如何在Firebase中实现此.htaccess?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆