I am in the midst of picking up some advanced webmaster techniques. SSI is next on my list. Here's where I am and the problems I am having.
I have enabled SSI on my server as well as CGI...no problems. I have scoured the web for SSI tutorial, they all tell me the same thing, but don't answer any of my problems. The problem my site is having is that only the index.shtml file in my DocumentRoot directory will execute SSI comments. Files named other than that int he DocumentRoot directory and files in sub-directories, even those named index.shtml, do not execute these commands.
Any ideas off the bat? Or do I need to give more more info?
Either way, please lemme know.
Oh yeah,....THANKS in advance. I'm excited to get this working, I really love this stuff. =] (read: no sarcasm)
--JeremyI don't know about server permissions, but have found, if you want SSI to work on both Linux Apache and NT, you should refer with
include file="./myfile.txt"
to your txt file, so a dot plus slash to indicate "this folder".
Also have no spaces at the start between
<!--#include
but do have a space before the end
file="./myfile.txt" -->
(Sorry to break up the line, just wanted to avoid errors.)This is how I'm calling my SSI comments.
<!--#include virtual="/header.html" -->
Now, this call works when I load index.shtml in my DocumentRoot directory. But it won't load jack when I put it in any other .shtml file (even those in the DocumentRoot directory.)
It appears to me that the only file the will SSI is index.shtml in the DocumentRoot. How to fix this? I don't know.
--Thanks,
JeremyIs it maybe a matter of the server not parsing any other file other than index.shtml in the DocumentRoot?
I'm running Apache on Linux-Mandrake 8.0 by the way.
I'm running out of ideas and things to try. Anyone with advice?
Thanks,
JeremyIts more than likely that your httpd.conf file has only been set up to allow the extensions of .shtml to process SSI's. Add the extensions you want to use SSI's with and it should work.But I'm not trying to parse any other file type. All the files that I've mentioned above our .shtml. The couple of lines in my httpd.conf follow:
Options ExecCGI Includes
My version of apache has a commhttpd.conf file as well. And this code is in there:
AddType text/html .shtml
AddHandler text/x-server-parsed-html .shtml
I thought that this makes all .shtml files parsable by the server, am I wrong?
Once again, index.shtml in the DocumentRoot directory gets parsed by the server...but no other .shtml within the DocumentRoot gets parsed. Moving a file from its original name (say jokes.shtml) to index.shtml, makes the file parsable by the server.
Why only index.shtml in the root directory? is my question.
Thanks,
JeremySorry,
totally misunderstood. That is something I have never come across but I'l see if I can find out anything for you. Watch this space.Originally posted by JereBear
This is how I'm calling my SSI comments.
<!--#include virtual="/header.html" -->
Now, this call works when I load index.shtml in my DocumentRoot directory. But it won't load jack when I put it in any other .shtml file (even those in the DocumentRoot directory.)
It appears to me that the only file the will SSI is index.shtml in the DocumentRoot. How to fix this? I don't know.
--Thanks,
Jeremy
the problem is the / in your include statement.
try this...
<!--#include virtual="header.html"-->
SSI will also work with files in sub dir's of the root when accessed accordingly.
EXAMPLE: you have a "footer.html" in the root and you want to enact it on 7 pages
the first page is the index.shtml in the root and the include would look like this
<!--#include virtual="footer.html"-->
the second, and third pages are in sub dir's and you can add the footer.html with this code on the sub level pages
<!--#include virtual="../footer.html"-->
and finally, the 4th threw the 7th pages are sub-sublevel pages (two dirs below the root) and you access the footer in those with this line of code
<!--#include virtual="../../footer.html"-->
this will solve your problem, and if you need some more documentation on this, just ask!
playing with pixels
chris<pixelmonkey>:monkeyixelmonkey...I'm afraid I have bad news (at least for me). Still no dice.
I have tried everything in your above post and still, only index.shtml in the root loads the SSI calls. I have also tried putting the header and footer files in the sub directory and making the call to that new file, nothing.
Can you think of anything in the server config that would prevent the server from parsing files? I think thats the problem, the server is only parsing index.shtml in root. If I move a .shtml file out of a subdirectory and name it as index.shtml in root, it loads the call. Whereas it wouldn't in the subdirectory.
I'm up for anyhting right now...reload Apache?
--Jeremyhummm... i havent had this problem before. in your setup, do you have the server extentions to call the shtml files first? if not, you will want to be sure to address all links with the file name and extention when accessed in a sub dir. re-installation of appache isnt likely neccessary (what version are you running?) but is an option.
have any links we can view to help with this one?
chris<pixelmonkey>:monkey:Everything is coo (as the pigeon says).
My version of Apache (1.3.19) has two conf files. httpd.conf and commonhttpd.conf. I had to add the "Includes" option to the root directory in commonhttpd.conf....and now everything is hunkydory.
If anyone is having a similar problem, let me know and I can describe it in more detail.
Thanks Guys,
Jeremy
I have enabled SSI on my server as well as CGI...no problems. I have scoured the web for SSI tutorial, they all tell me the same thing, but don't answer any of my problems. The problem my site is having is that only the index.shtml file in my DocumentRoot directory will execute SSI comments. Files named other than that int he DocumentRoot directory and files in sub-directories, even those named index.shtml, do not execute these commands.
Any ideas off the bat? Or do I need to give more more info?
Either way, please lemme know.
Oh yeah,....THANKS in advance. I'm excited to get this working, I really love this stuff. =] (read: no sarcasm)
--JeremyI don't know about server permissions, but have found, if you want SSI to work on both Linux Apache and NT, you should refer with
include file="./myfile.txt"
to your txt file, so a dot plus slash to indicate "this folder".
Also have no spaces at the start between
<!--#include
but do have a space before the end
file="./myfile.txt" -->
(Sorry to break up the line, just wanted to avoid errors.)This is how I'm calling my SSI comments.
<!--#include virtual="/header.html" -->
Now, this call works when I load index.shtml in my DocumentRoot directory. But it won't load jack when I put it in any other .shtml file (even those in the DocumentRoot directory.)
It appears to me that the only file the will SSI is index.shtml in the DocumentRoot. How to fix this? I don't know.
--Thanks,
JeremyIs it maybe a matter of the server not parsing any other file other than index.shtml in the DocumentRoot?
I'm running Apache on Linux-Mandrake 8.0 by the way.
I'm running out of ideas and things to try. Anyone with advice?
Thanks,
JeremyIts more than likely that your httpd.conf file has only been set up to allow the extensions of .shtml to process SSI's. Add the extensions you want to use SSI's with and it should work.But I'm not trying to parse any other file type. All the files that I've mentioned above our .shtml. The couple of lines in my httpd.conf follow:
Options ExecCGI Includes
My version of apache has a commhttpd.conf file as well. And this code is in there:
AddType text/html .shtml
AddHandler text/x-server-parsed-html .shtml
I thought that this makes all .shtml files parsable by the server, am I wrong?
Once again, index.shtml in the DocumentRoot directory gets parsed by the server...but no other .shtml within the DocumentRoot gets parsed. Moving a file from its original name (say jokes.shtml) to index.shtml, makes the file parsable by the server.
Why only index.shtml in the root directory? is my question.
Thanks,
JeremySorry,
totally misunderstood. That is something I have never come across but I'l see if I can find out anything for you. Watch this space.Originally posted by JereBear
This is how I'm calling my SSI comments.
<!--#include virtual="/header.html" -->
Now, this call works when I load index.shtml in my DocumentRoot directory. But it won't load jack when I put it in any other .shtml file (even those in the DocumentRoot directory.)
It appears to me that the only file the will SSI is index.shtml in the DocumentRoot. How to fix this? I don't know.
--Thanks,
Jeremy
the problem is the / in your include statement.
try this...
<!--#include virtual="header.html"-->
SSI will also work with files in sub dir's of the root when accessed accordingly.
EXAMPLE: you have a "footer.html" in the root and you want to enact it on 7 pages
the first page is the index.shtml in the root and the include would look like this
<!--#include virtual="footer.html"-->
the second, and third pages are in sub dir's and you can add the footer.html with this code on the sub level pages
<!--#include virtual="../footer.html"-->
and finally, the 4th threw the 7th pages are sub-sublevel pages (two dirs below the root) and you access the footer in those with this line of code
<!--#include virtual="../../footer.html"-->
this will solve your problem, and if you need some more documentation on this, just ask!
playing with pixels
chris<pixelmonkey>:monkeyixelmonkey...I'm afraid I have bad news (at least for me). Still no dice.
I have tried everything in your above post and still, only index.shtml in the root loads the SSI calls. I have also tried putting the header and footer files in the sub directory and making the call to that new file, nothing.
Can you think of anything in the server config that would prevent the server from parsing files? I think thats the problem, the server is only parsing index.shtml in root. If I move a .shtml file out of a subdirectory and name it as index.shtml in root, it loads the call. Whereas it wouldn't in the subdirectory.
I'm up for anyhting right now...reload Apache?
--Jeremyhummm... i havent had this problem before. in your setup, do you have the server extentions to call the shtml files first? if not, you will want to be sure to address all links with the file name and extention when accessed in a sub dir. re-installation of appache isnt likely neccessary (what version are you running?) but is an option.
have any links we can view to help with this one?
chris<pixelmonkey>:monkey:Everything is coo (as the pigeon says).
My version of Apache (1.3.19) has two conf files. httpd.conf and commonhttpd.conf. I had to add the "Includes" option to the root directory in commonhttpd.conf....and now everything is hunkydory.
If anyone is having a similar problem, let me know and I can describe it in more detail.
Thanks Guys,
Jeremy