Matt Holme
03-18-2006, 04:07 AM
Just a basic question. I have an old website on our server which is just an archive.
I recently upgraded to the latest Redhat and Apache and having done so have noticed that the .html files that used to work with SSI don't work anymore.
For example, index.html doesn't display includes.
But index.shtml does work.
I know the simple answer would be for me to rename html files to shtml files, but there are literally 100's of files and many hyperlinks referencing them.
Is there anyway to make .html files work with SSI?
Any help is appreciated. Thanks.
You would need to associate .html files with the respective handler. Add the following to your httpd.conf
AddHandler server-parsed .html
hello-world
03-18-2006, 02:52 PM
It is better that you set the 'treat only executable htmls as ssi" in apache, and then turn executable bit for the html files that needs to be SSIed. Else, apache will needlessly parse all the html files.
Else, apache will needlessly parse all the html files.
Not needlessly, this is obviously what Matt asked for.
hello-world
03-18-2006, 03:10 PM
Not needlessly, this is obviously what Matt asked for.
Yeah, but with executable SSI mode, you can have SSI on specific htmls. It just reduces the load on the server, yet gives you what you want.
Yeah, but with executable SSI mode, you can have SSI on specific htmls. It just reduces the load on the server, yet gives you what you want.
Yes, if you have a handful it might be useful (but then you can name them .shtml too), however
there are literally 100's
doesnt make this impression.
hello-world
03-18-2006, 03:47 PM
Yes, if you have a handful it might be useful (but then you can name them .shtml too), however
doesnt make this impression.
It depends on the load/number of hits etc. Executable htmls are a more efficient way to do shtml under apache. I don't want to turn this into a nitpicking competition however. :-)
--
:: Ligesh :: Lxadmin Core Developer
:: http://demo.lxadmin.com:7778
:: http://lxlabs.com/software/lxadmin/
Executable htmls are a more efficient way to do shtml under apache.
Please elaborate on that.
hello-world
03-18-2006, 04:09 PM
Please elaborate on that.
The point is to enable shtml for html files. You selectively enable it only for the html files that contain includes. It is very evident that ALL html files cannot contain includes, since that would create infinite loops. So there would only be a few top level html files that includes other files, and the rest would be plain html files that are contained in the main files.
If you don't enable executable bit, apache will parse ALL files and search for the include tag in every html file which is not necessary.
But, as you said, if you have only a few html files, that is ok.
thanks.
--
:: Ligesh :: Lxadmin Core Developer
:: http://demo.lxadmin.com:7778
:: http://lxlabs.com/software/lxadmin/
:: Get Free 2-server Licenses :: promotion@lxlabs.com
Matt Holme
03-18-2006, 05:14 PM
Thanks for the fix guys. We put the parse in Apache config.
No problem, you are welcome.