Search code examples
phpfirebase.htaccessfirebase-hosting

Firebase .htaccess to json


I searched and found out .htaccess does not work in firebase only firebase.json i want to make firebase.json to read .html files to php like this in .htaccess

[Apache2 @ Ubuntu/Debian: use this directive]

AddType application/x-httpd-php .html .htm
Or, from comment below:

AddType application/x-httpd-php5 .html .htm
If your are running PHP as CGI (probably not the case), you should write instead:

AddHandler application/x-httpd-php .html .htm 

Solution

  • Firebase Hosting doesn't have support for evaluating PHP code. In fact, it doesn't directly support any backend code execution.

    Your options for running backend code through Firebase Hosting is limited to integrations with Cloud Functions and Cloud Run. If you must run PHP, then Cloud Run is your only option, and it will be a fair amount of work to get that solution fully configured and running.