Forum Moderators: phranque

Message Too Old, No Replies

How to use SSI on regular .html pages

         

deepavs

11:03 am on Oct 22, 2003 (gmt 0)

10+ Year Member



I need to use SSI on regular .html pages.

When I add the following to the .htaccess
(to force .html pages to be parsed like .shtml pages):

AddHandler server-parsed .html

...then the Internet Explorer forces me to download/save as the .html pages to my harddisk when I go to the page url through IE. The downloaded copy shows that the SSI has been successfully run.

Is this the problem/setting of my browser or is something wrong
with the .htaccess?

jdMorgan

3:49 pm on Oct 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



deepavs,

Sounds like the MIME type may be wrong - Otherwise, the browser should have no idea that SSI is being used on the server side, and you should see no difference in browser behaviour.

I'd recommend checking the headers [webmasterworld.com] your server is sending along with the page -- compare them between the non-SSI case and the SSI case and see what the difference is.

The Apache mod_include documentation [httpd.apache.org] shows that AddType may be needed in addition to AddHandler. If that does not work, you can always use the XBitHack directive, also documented in mod_include.

Jim

deepavs

4:00 pm on Oct 23, 2003 (gmt 0)

10+ Year Member



Thanks jdMorgan!

The headers checking was very useful and revealed me that the final file sent to IE was .php hence the "open/save as" dialog box.

The problem lied in my .htacces where I also tried to force .html files to be parsed as .php

The right order which lets the .html files to be treated as .php and also .shtml is:

AddType application/x-httpd-php .html
AddType text/html .html
AddHandler server-parsed .html