问题
Can we restrict access to website with firebase hosting to prevent search engine indexing? This would be helpful for dev/staging environments.
Something like AWS Amplify restricting access https://docs.aws.amazon.com/amplify/latest/userguide/access-control.html
回答1:
You can control whether a crawler indexes your site with the usual robots.txt
instructions. Note that this file is not specific to Firebase Hosting, and commonly used to control if/what parts of a site bots crawl.
But aside from that, there is no way to control access to the files in Firebase Hosting; all files are world-readable.
See also:
- Prevent Search Engine Indexing of Angular 5 Website - Firebase for some examples of a
robots.txt
. - Can Firebase hosting restrict access to resources?
来源:https://stackoverflow.com/questions/61861570/firebase-hosting-restricted-access