A part of my firebase app is to serve PDF files on firebase storage to users. When they open those files the bucket downloadurl is visible to all users for example:
https://firebasestorage.googleapis.com/v0/b/my-project/o/file.PDF?alt=media&token=5btfzb29-f3cf-4557-8741-bfd3f12b1e86I
I want to serve files under:
https://custumdomain.com/file.PDF?alt=media&token=5btfzb29-f3cf-4557-8741-bfd3f12b1e86I
Since I couldn't find any option in my firebase console or cloud storage to achieve this, so I tried to set up a .htaccess redirect.
I tried:
RewriteEngine On
RewriteRule ^(.*)$ https://firebasestorage.googleapis/$1 [P]
The requested document is shown, but the user is also visibly redirected. So my question is divided into 2 parts:
1. Is this the right way to achieve my goal? Is there an easier solution provided by cloud storage?
2. Why is my proxy flag not working as intended? What do i need to change to hide the redirect?