开发者

Can I change the accepted extensions by PHP?

I'd like to accept other type of file开发者_运维知识库s that contains PHP code. For example, it would be nice to read an .aspx file by PHP as if it were .php.


Add this to your .htaccess file in Apache to make html parse as PHP:

AddType application/x-httpd-php .html

You can extrapolate what you need to do from there. :-)


Use this htaccess rule:

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


Yes, this is done in your Apache configuration. You tell apache what kind of files you want it to send to the PHP engine. You can do this configuration the same way you do other apache configuration - in the main config file, per site, or in .htaccess files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜