redirect all .html extensions to .php

前端 未结 6 1213
花落未央
花落未央 2020-11-30 08:31

I want to update all the pages on a website to use include for the footer and header. So I have to change a lot of .html pages to .php.

So i\'m looking for a way to

6条回答
  •  生来不讨喜
    2020-11-30 09:28

    In your apache httpd.conf file you can add

    AddType application/x-httpd-php .html
    

    to make .html files go through the php parser before they are served to the user. You can also add this directive to your .htaccess file. The second method may not work depending on how your host is setup.

提交回复
热议问题