how do I do a include of one html file in another file. I thought putting it is as,
<!--#include file="./top.htm"-->
within the body tags would do. BUt that didnt seemed to work.
Please advise.
Thanks.
The file that you include can be virtually any static page, if the file that you include is a .shtml file then you can also use nested include statements on that page as well.
If you want to execute a cgi script then the following code may also be used:
<!--#exec cgi="/path/to/my/file.pl" -->
There are also quite a few more advanced things that you can do with SSI such as, display browser version, IP, Date & time etc, but these use a different syntax.
in the /apache_home/conf/httpd.conf
There was a commented bit of .shtml which I uncommentd to look like this. But this still dont work.
#
# To use server-parsed HTML files
#
AddType text/html .shtml
AddHandler server-parsed .shtml
Now, you can add .html to that statement but if your server has a high turnover of visitors then it starts to get resource intensive.
Whatever extension you specify, the server ALWAYS looks for SSI in that file so even if you only had one html file that actually has SSI calls, every single file is still parsed for SSI.
If you still want to do it then the following syntax should be used.
Sorry, I just had this thought at the back of my head for sometime. But what is the htaccess thing for. I thought htaccess was for limiting access to pages and stuff. Never really tried it though. Good links for that would be great !! But again the question is how does your last suggestion work ??
edit:
Just add the following lines to a htaccess file in whatever directory you want this change to take effect.
If one of your users wanted to implement this, they could add it to a htaccess file and do it all themselves, rather than having to contact you and get you to do it for them in the httpd.conf.
I have never found a good tutorial on htaccess but if you visit the Apache site and take a look at all the directives, if they specify that they can be used in the VHost directives then they will also work in htaccess files.
To ebable htaccess to be able to do all of this your httpd.conf must have the following for the directory in question or globally:
AllowOverride All
If you just want to specify that only User Authentication can be used then the following should be applied:
AllowOverride AuthConfig
The AllowOveride just tells Apache what a htaccess file can actual override in the httpd.conf. So if you specify config for a directory in the httpd.conf and have the above statement allowing htaccess to override it, then any htacces in those directories would in effect make your global config not be used.
Remember though that whatever you specify in a htaccess file also applies to any subdirectories of that folder unless they have their own htaccess file.
Getting bit and pieces of it. Can you post a sample htaccess file, plzzz.
Have another doubt which I guess is related. How good a thought is it to have all pages loaded through https. I have compiled apache with ssl and openssl. So it does allow for encrpted transmission (I guess !!). So if I on my website href all my links to "
then all the tranmissions over the network will be encrypted. But is there a better way than that becuase sometimes you dont alwyas specify the full url as in,
<a href="
<H1>News and Events</H1> </a>
Sometimes you do a relative <a href="../another.html">
and also I did a fair bit of seraching for shtml (atleast for the abbreviation), but couldnt get what I wnted. More, I found pages as jhtml, etc. So what are these things and shtml got anything do with security as in secure html.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.