How to parse PHP syntax in a .html file on server?

后端 未结 4 663
一向
一向 2021-01-22 07:29

This feels like an extremely n00b question, but here goes...

I have a series of HTML files with a small amount of HTML content inside each (exported from a live system).

4条回答
  •  [愿得一人]
    2021-01-22 07:45

    Well I'm rather sure you're not very accustomed to the way the apache engines works with php. In truth, this isn't a php question but an apache one (in case you're using apache, which I will assume)

    The simplest way of doing this, is to add a .htaccess with the following contents:

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

    This basically tells apache that all .html files should be parsed by PHP, read more about it here.

    What you actually saw, I suspect are URL rewrites, read more about mod_rewrite.

提交回复
热议问题