|
Posted by David on 07/01/06 15:29
Lee wrote:
>>> AddType application/x-httpd-php .htm (or .html OR both!)
>>>
>>> This needs to be placed either in an .htaccess or within the
>>> configuration file for your
>>> server.
>> I would suggest against this. Files that are appended with .php are
>> processed by the server and output to the browser as text/html files,
>> so if you want to use PHP inside normal webpages, simply rename your
>> html files .php. If you change the htaccess configuration so that the
>> server parses .html files, the server has to scan and check every
>> single html file that is output, and especialy if you have a good
>> number of html files which are just static html, that's a waste of
>> server resources and speed. I would suggest reserving .html to files
>> which never need to output dynamic content, and any html files which
>> need processing can use .php instead.
>
> It's just in the one .html file and just a 'simple' read .txt file and
> display what is in that file. Which btw would be very little.
>
>
That doesn't matter if it is only in one page. That AddType statement is
telling Apache to scan *ALL* html pages for php. Apache doesn't care if
there is php code in just one of your pages or every single page on the
server. The *BEST* way is to change that individual page to have the
extension of '.php'
If for some reason that can not be done you can use the XBitHack and use
chmod +x filename.html
This will tell Apache to *ONLY* parse the given filename for any '.php'
code. This is still a much better way than the first method suggested.
Navigation:
[Reply to this message]
|