Re: File extensions



J.O. Aho wrote:
shimmyshack wrote:

your server is set up to execute the php inside the files if they end
in .php which is normal. Stuart meant that if you have control over
the server you could change this to say only .pjio files or
a .phtml, .php and .php5 all at once etc.. whatever you choose

There is those who uses

AddType application/x-httpd-php .html

Which will cause the server to work extra as it will parse all html files, of which most usually don't have any php at all.

#allow only .php and .htm to be parsed for php code
AddType application/x-httpd-php .php .htm


#allow .php, .htm, and .mycustomextension to be parsed for php code
AddType application/x-httpd-php .php .htm .mycustomextension

All other extensions (unless dealt with appropriately) will be served as static HTML, eg: .html, .shtml, .mystatichtml, etc.

Norm
.



Relevant Pages

  • Re: PHP-Yes, HTML-No --- Why?
    ... You are arguing to have .html at the end of every URL even if the file contains PHP or another scripting language. ... We are talking about web servers, not FTP servers. ... I never said the server should parse MP3 files or whatever, ...
    (comp.lang.php)
  • Re: PHP-Yes, HTML-No --- Why?
    ... The .html signifies that the file contains HTML - and pretty ... A php script contains both HTML and PHP code so technically speaking it's not just HTML. ... The user is getting a file from your web server, an HTML file, and it has an extension of something other than HTML. ... I hope you weren't configuring them as per your personal likes and dislikes but instead were configuring them as per the customer requirements and for speed, ...
    (comp.lang.php)
  • Re: PHP-Yes, HTML-No --- Why?
    ... they don't have any PHP in them. ... which does indeed do away with extensions altogether. ... I hit two identical servers, one set to parse html via php, and one ... html-parsing server being quicker, ...
    (comp.lang.php)
  • Re: PHP-Yes, HTML-No --- Why?
    ... When I do generate them, I can still have PHP providing them, AND keep the .mp3 as an extension, because of the tools I use on my site. ... The site is a whole - asking someone to ignore the mess in the address bar because "it's just the way the web server works" is a bit silly. ... The .html signifies that the file contains HTML - and pretty ... mean they "get" it with a browser and thus the URL has a .php at the end of it. ...
    (comp.lang.php)
  • Re: How do we get there from here?
    ... > then sub the whole of that generated markup into the template? ... layed out on the fly, a simple IMG tag, or even an entire HTML document. ... PHP scripting provides 10 times the features of both of these ... idea as tokens can eliminate a huge amount of maintance, ...
    (comp.databases.pick)