I do not think it's actually working in any browser, but other browsers other than chrome should be downloading the file instead of displaying or they should be interpreting as text/html
, which ignores php tags thinking they are tags html, chrome should be interpreting as plain/text
.
How I responded here:
Understand that Apache , Ngnix and other equivalent servers do not use standard extensions, you actually customize it, you can even invent the extension itself if you wish , for example by editing httpd.conf
in apache:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .miguel
Done, it will be possible to use .miguel
as an extension to run php files. You can still add index files with custom extensions for example:
<IfModule dir_module>
DirectoryIndex index.php index.pl index.html index.htm index.miguel
</IfModule>
So that .phtml
and .php
are custom things anyway and if you want to add do this:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
And this:
<IfModule dir_module>
DirectoryIndex index.php index.pl index.html index.htm index.phtml
</IfModule>
Note: Note that not all hosting will allow you to customize your extensions, and the best thing to do is to stay in the most common way of using .php
for everything, and do not use extensions