Using .htaccess to make all .html pages to run as .php files?

前端 未结 16 1642
忘了有多久
忘了有多久 2020-11-22 00:41

I need to run all of my .html files as .php files and I don\'t have time to change all of the links before our presentation tomorrow. Is there any way to \"hack\" this with

16条回答
  •  独厮守ぢ
    2020-11-22 01:21

    Normally you should add:

    Options +ExecCGI
     AddType application/x-httpd-php .php .html
     AddHandler x-httpd-php5 .php .html
    

    However for GoDaddy shared hosting (php-cgi), you need to add also these lines:

    AddHandler fcgid-script .html
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .html
    

    Source: Parse HTML As PHP Using HTACCESS File On Godaddy.

提交回复
热议问题