>In article <MPG.1571fca7d...@news.clear.net.nz>, Patrick Dunford <a47...@hotmail.com> writes:
>|> >As I have my own web server running Apache I can say that that is not true,
>|> >Apache just looks at the file type.
>|>
>|> As I have my own web server running Apache I can say that that is true.
>|>
>|> For example my server is running PHP. Apache is instructed to pass files
>|> with a .php or .php3 extension to the PHP server for processing.
>
>Then you have not set it up right, it should be searching for the file type
>not the extension.
Read the documentation for the AddType directive. Specifically:
"The AddType directive maps the given filename extensions onto the specified
content type. MIME-type is the MIME type to use for filenames containing
extension. "
So as you can see, Apache DOES use the File type of the files that it is
asked to serve.
In my httpd.conf file I have the following:
AddType application/x-tar .tgz
AddType application/x-httpd-php .php .php3
AddType application/x-httpd-php-source .phps
AddType text/html .shtml
These are the mappings for tar gzipped files, PHP files, PHP source files
and HTML files containing Server Side Includes. They tell Apache to
associate the file extensions shown with the mime types shown. This is
essential when sending files to a browser; the Mime type is send in the
headers and the browser interprets the content accordingly.
If you call a HTML file homepage.gif, it's likely that the MIME type sent to
the browser will cause it to try to interpret your home page as a GIF image.
I tried once renaming my file as a .zip file instead, and of course what
happened is, insteading of displaying the HTML file that it actually was, my
browser immediately prompts me to save the file as a download.
See also: AddHandler
"AddHandler maps the filename extensions extension to the handler handler-name.
For example, to activate CGI scripts with the file extension ".cgi", you
might use:
AddHandler cgi-script .cgi
--
=======================================================================
Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/
For we are God's workmanship, created in Christ Jesus to do good
works, which God prepared in advance for us to do.
-- Ephesians 2:10
http://www.StudyLight.org/desk/?query=Ephesians+2:10