How to make Apache serve index.php instead of index.html?

后端 未结 3 586

If I put the following line in a index.html file, to make Apache include the index.php file:

  

        
3条回答
  •  离开以前
    2020-11-30 04:14

    PHP will work only on the .php file extension.

    If you are on Apache you can also set, in your httpd.conf file, the extensions for PHP. You'll have to find the line:

    AddType application/x-httpd-php .php .html
                                         ^^^^^
    

    and add how many extensions, that should be read with the PHP interpreter, as you want.

提交回复
热议问题