Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server Side Include not working. Please help.

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I set the server side in a template and then update my site using that template and it doesn't show up in the table/cell that I assigned the SSI code ot be in. I was told that SSI sometimes doesn't show up on your local machine, so I uploaded the htm (both the htm and the htm that has the SSI in it) and it still doesn't work. I even emailed my host to make sure their server supports Server Side Include and they said it does. I am all out of ideas. Please help me out here. I am working on a new design for my site (CuttingTheEdge.com) and I am being held up by this problem. Any help would be great. Thanks
 
Yes. I made a page with a SSI file, and forgot to save it as .asp. If you are using personal web server in your machine, you should see the SSI behavior.
 
ok when I rename the htm file to shtm it sorta worked. Where I wanted it to show the SSI in a table, it says "Error processing SSI file '/ssi/news.htm'" So that means that it's trying, but for some reason it can't. Anybody know why? I checked to make sure the server is a windows server and my host "says" on their website they are running windows servers so I use the "file" option instead of "virtual" option as the dreamweaver help specifies. Please help.

Thanks.
 
1- The main page needsdto be .shtml or.shtm. If not it wont be recognised as having a server side include by the serverand therefore wont dosply it.

2- For convention you should name the extension of the file includied something unquie for html etc. An extensiuon used alot is .htmlf. When yous site has a lotof pages it is good to quickly differentiate file- even put them in a different folder called 'ssi' or somethiong.

3- this is the most important-ensure that the included file (say the htmlf file) does not include the full html
markup
- so no <head> and no <body> tages just the relevant table,graphics etc etc.

A page cannot display properly with two bosy etc and this maybe your problem (although browers display the problem differently)

Caspar Kennerdale
Senior Media Developer
 
1. I already changed the name to shtm, like I said above. That's when it started to show the error message of the SSI not being processed. Before it didn't even show that error, so now I know that it's at least trying.

2.I put all my htm files that are the SSI files in an SSI directory.

3. I had the problem before of having the head and body tags in there and it made it look totally weird, that was one of the first problems I fixed when I was learning SSI.

I can't figure this problem out. the line of code in the index.shtm file to use the SSI code is (without the quotes)

&quot;<!--#include file=&quot;/ssi/news.htm&quot; -->&quot;

and the index.shtm file is in the root of my site. I already double checked that the news.htm file is in the ssi directory and made sure it was called news.htm

I have no other ideas as to what I should do. I test it with dreamweavers preview by hitting f12 and it looks fine. Once I save the file and just double click the htm file when it's locally it doesn't show the SSI code. I was told this is because of the SSI engine thingy you mentioned before. The weird thing is, is that it shows just perfect on the dreamweaver preview, and yet it doesn't look anything like that when viewing it from the server. Any more ideas??
 
So it previews in Dreamweaver? Yes
It Doesnt work locally or on your server? Yes
It just keep on coming up &quot;Error processing SSI file '/ssi/news.htm'&quot; ? Yes


I wouldnt be too influenced by what Dreamwearver shows you,if it doesnt work on your server then it doesnt work.

Try re-naming news.htm to something different such as news.htmlf. This may be confucing it,

Try renaming from shtm to shtml (long shot but your ISP may have onlyset up one of the two)

If still no joy send the main page and the news.html to caspar@thetuckshop.comand I'll have a look Caspar Kennerdale
Senior Media Developer
 
I don't use links (or in this case, I would not include a file) in templates with DW-U. The pages made with the template always try to find the files in the templates folder. Maybe it's the problem.
 
ok here's what I found out. Server Side Include wont work in a template. It must having something to do with the code. This is kinda lame if you ask me, because I'm trying to have this info that the SSI calls on all the pages of the website, but since I can't put the SSI line to call the htm file in the template then how the heck do I do it? Is there any other way? I was thinking I could have my template and have the tables/cells that I want the SSI in editable. That way I can change them on any page. Then make 1 page that I use to start all other pages from. That page would have the SSI line in all the tables and cells that I need them in. That's my only other idea. If you have any other ideas, please tell me. Thanks for all the help. :)
 
gcastillo,

Here is my take on this.

At first you were getting nothing. That was because you didn't have the .shtm or .shtml extension. Then you corrected the extension, but now you get the error message &quot;SSI not being processed&quot;. In a way this is good because it shows you have started in the right direction. You are getting that error message because now the existance of a SSI file is being recognized, but the server just can't find the file.

The first question is &quot;why can't the server find the file?&quot;

Possible answers:
1)The path to the file may be incorrect.
2)The path to the file is correct, but not relitive to where it is being called from.

For example, is the .shtml file that contains the include in the root directory, or in a sub directory? Using your example above, if the .shtml file calling the include is in the &quot;root directory&quot; and =&quot;/ssi/news.htm&quot; is the correct path, try &quot;ssi/news.htm&quot; without the beginning backslash.

If the .shtml file that contains the include is in a sub directory like &quot;here/thewebpage.shtml&quot;, then you would need to use &quot;<!--#include file=&quot;../ssi/news.htm&quot; -->&quot; for it to find the include file from the HTML file stored in the directory named &quot;here&quot;. The only problem then is that the include file would be found, but the include file itself would not find images or other paths contained within itself. Because the include file would be looking for things from within the &quot;home directory&quot; rather that the root directory where it's own paths are correct.

I know my explanation sounds confusing, but take some time to digest it. The most ideal way for SSI to function is when all the .shtml / .shtm files are in the same place, and all call the include files from the same place.

Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top