using includes

Ken M

New member
Joined
Nov 19, 2007
Messages
2
Hi,

First time to the forum, so hi to all.

I just had all my domains moved to a new server which uses DirectAdmin. Previously I was able to use includes to show a file within my html. Since the changeover none of the includes are showing.

Code was like this: <!--#include virtual="/lfilename.txt"-->

Any idea on what I need to do to get these to show up?

Thanks,

Ken
 
Try this and let us know if it works. Create a file named .htaccess (notice the dot in front of the file name) in your domains public_html directory and place the following in the file:

Code:
Options +Includes
AddType text/html .html
AddHandler server-parsed .html
AddHandler server-parsed .htm
 
DirectAdmin, by default, uses files with a .shtml extension as the files it parses for includes. The code that I gave you tells Apache to also parse .htm and .html files for include directives as well as the normal .shtml files. Glad this worked for you, welcome to the forum, and enjoy DirectAdmin.
 
I just found an alternative to the .htaccess method for doing this, that might be a little more user-friendly. I don't know why I did not think of this at first. But, here is what you can do:
  1. Login to your User Level panel.
  2. Click on Apache Handlers under Advanced Features.
  3. In the Handler text box, enter "server-parsed" (without the quotes).
  4. In the Extension text box, enter ".htm .html" (without the quotes).
  5. Click on the Add button.
Hope this helps. :)
 
You know, of course, that there's a reason why well behaved HTML programmers use shtml instead of html, right ;) ?

If you add the code to tell apache to parse .htm and .html files, it can really slow down the server, since in effect you're telling apache to read each file instead of just sending it.

So good neighbors on shared servers will do the required renaming so as to be able to use .shtml.

Jeff
 
the effect is minimal

i've never noticed much of any effect by having php parse html files. not sure on shtml type files, but php doesn't seem to slow things down on a server with 100 sites or so.

just my $.02.

joe
 
Back
Top