Firebase Hosting - How to prevent access for some files

跟風遠走 提交于 2019-12-11 15:57:21

问题


I have couple of html files in public folder at firebase hosting listed as below.
index.html content_1.html content_2.html app.js app.css

consider domain name is example.com

as of now user can access all these file using syntax example.com/content_1.html or example.com/app.css.

is it possible to prevent direct access to these files but index.html ? I use these files while building the index.html through jquery

In Apache would have used Order allow,deny and Allow from all at httpd.conf, but not sure how to achieve this on Firebase Hosting.

Thanks in advance for your help


回答1:


is it possible to prevent direct access to these files but index.html ? I use these files while building the index.html through jquery

You cannot simultaneously provide indirect access to a resource required by a web page and block it from direct access at the client level regardless of the web server being used unless you're assembling things on the server first.



来源:https://stackoverflow.com/questions/48140014/firebase-hosting-how-to-prevent-access-for-some-files

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