Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Anything Goes
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:39

OT - Server Side Includes question


Poster: tepidarium
Dated: Tuesday March 9 2004 - 15:16:44 GMT

Hi all - I would like to convert my website to serverside includes but am having a problem. Basically, the shtml file is not recognized by the browser. I'm using IE and when I go to the page it simply says page not found. Here's the url:

http://www.citytech.cuny.edu/test1.shtml

The page IS on the server.

The server people do not know what is wrong. The includes do work in asp - but I want to use SSI. Anyone know if the server has to be configured in a certain way?

Thank you for any help you can provide! :D :D


Poster: John
Dated: Tuesday March 9 2004 - 18:30:51 GMT

Hey tep...

Not all servers require shtml in order to use includes. Apache, and I think IIS, have settings to allow the server to 'include' with just html.

For instance, my http://pdaoutlet.biz/, running on Linux/Apache and with index.html, uses at least 3 includes with no problems. In my case it's...
Code:
<!--#include virtual="file.html" -->

Not sure at all about your 404, but I'd worry about an ISP that couldn't help in that regard.


Poster: tepidarium
Dated: Tuesday March 9 2004 - 19:12:42 GMT

Hi,

Thanks for your reply :D

The includes in the normal html files don't work either...

I did some reading that seems to indicate that the apropriate file extention (i.e. shtml) needs to be entered into a file for those extensions to be recognized. Something about a "srm.conf" file or htaaccess ... do you know anything about this... I know we're using IIS...


Poster: John
Dated: Tuesday March 9 2004 - 22:01:19 GMT

Are you running this server yourself, or is it an ISP?

There is a way to get the server to parse include files without having 's' in the suffix, but, according to my IT folks, a number of things can go bad (M$ lives!) - including asp, indexing, certain bots in FP, etc.

I'm not running IIS, so I don't have an exact answer, but basically right-click on My Computer, Properties, find the server tab, click on the root level icon, and "somewhere in there" is a tab that will allow you to make the addition. Not much help, I know, but best I can do off the top of a few heads.

Bottom line - Apache... :roll:


Poster: tepidarium
Dated: Tuesday March 9 2004 - 22:07:19 GMT

jgillett wrote:
Are you running this server yourself, or is it an ISP?


I can only place/delete files on the server. I can't make modifications. It's in the IT dept. hands & out of mine... :cry:


Poster: John
Dated: Tuesday March 9 2004 - 22:10:53 GMT

tepidarium wrote:
jgillett wrote:
Are you running this server yourself, or is it an ISP?


I can only place/delete files on the server. I can't make modifications. It's in the IT dept. hands & out of mine... :cry:

Same situation here. But that's OK - got enough problems without having to worry about server admin on top of it all.

Tell your IT folks to read the books. It can be done.


Poster: fredlongworthhighschool
Dated: Wednesday March 10 2004 - 12:08:39 GMT

What about if you change the file extension to .SHTM ?

Our web servers have IIS here, but I decided to set up IIS on my own XP Pro laptop to do experiments on beforehand.


Poster: John
Dated: Wednesday March 10 2004 - 13:50:55 GMT

Either way, Andy, (shtm, shtml) I believe it still has to be mapped into the server so the files get parsed.


Poster: tepidarium
Dated: Thursday March 18 2004 - 20:08:24 GMT

Hey! THe IT guys got the shtml extension working!

A question for you SSI gurus - I read on Microsoft's site that good SSI style is to name include files with the ".inc" extension. Although almost any type of file can be included.

I named a a file with the .inc extension but dreamweaver won't let me open it. When I try to open the file in Dreamweaver I get the following message...

"Can't find a valid editor for this file extension."


What extension do you reccomend for include files? What do you guys do?

Thanks!


Poster: John
Dated: Thursday March 18 2004 - 20:28:05 GMT

Should I say "we told ya so"? Naw... :D

Anyway, 2 things come to mind. In DW Prefs under File Types/Editors the .inc should already be there as a default in the 'Open in code view:' line. If not, just add it to the others in the list. With Win, you might also need to add INC under Folder Options/File Types and set that to DW so the stupid OS knows what to do. The other would be to just end your include files in .htm or .html, as, I think, most of the rest of the world does (including me!).


Poster: tepidarium
Dated: Thursday March 18 2004 - 21:06:11 GMT

John wrote:
Should I say "we told ya so"? Naw... :D

Anyway, 2 things come to mind. In DW Prefs under File Types/Editors the .inc should already be there as a default in the 'Open in code view:' line. If not, just add it to the others in the list. With Win, you might also need to add INC under Folder Options/File Types and set that to DW so the stupid OS knows what to do. The other would be to just end your include files in .htm or .html, as, I think, most of the rest of the world does (including me!).


Hi John -

Thanks for your reply... :D

Is it okay to use .txt as an include...I tried it and it seems to work... any negatives with this extension?

Arg...now I've got to manually convert all .html apges to .shtml pages in the site window of DW... :x :x


Poster: John
Dated: Thursday March 18 2004 - 21:37:52 GMT

tepidarium wrote:
Thanks for your reply... :D

Is it okay to use .txt as an include...I tried it and it seems to work... any negatives with this extension?

Never tried .txt. Just always 'assumed' that since it was actually code I was including, that's what I'd call it.
tepidarium wrote:
Arg...now I've got to manually convert all .html apges to .shtml pages in the site window of DW... :x :x

If they did it right that shouldn't be necessary. I use plenty of includes on our IIS servers and no .shtml - just .htm.


Poster: tepidarium
Dated: Thursday March 18 2004 - 21:51:45 GMT

John wrote:
If they did it right that shouldn't be necessary. I use plenty of includes on our IIS servers and no .shtml - just .htm.


Well, from what I've read if you want normal html files to parse for includes, you've got to specify in the server settings.

I think it is a good idea to use the shtml file extension so you have an option to use normal html files where the server won't look to automatically parse the file thus taking a bit more load time... oh well, guess I gotta keep plugging away in DW site window!


Poster: John
Dated: Thursday March 18 2004 - 22:32:54 GMT

Correct, it will take a few extra cycles if you do it as I am, but it saved me having to change 500+ pages and I don't know how many links to .shtm!


Poster: kevin3442
Dated: Thursday March 18 2004 - 23:53:38 GMT

My two cents:

I don't use DW, but I assume that it has an internal code editor for common file types that uses some sort of syntax highlighting, no? Even if you specify your own editor, I would assume you'd use one with syntax highlighting. If so, I would assume that htm, html, and shtml are all recognized formats for the syntax parsing. If you name your include files as .inc, or especially .txt you, might lose the syntax highlighting, or at least have to tell it which syntax set to use for the file type.

Kevin


Poster: John
Dated: Friday March 19 2004 - 15:41:25 GMT

Correct, Kevin, and a good point. I've never tried .inc, although DW will handle it, but I suspect it won't highlight the same as a true .htm or .html file. Code errors could be missed that way.

Found a link that describes how to configure IIS


Poster: petbadbreath
Dated: Tuesday August 8 2006 - 4:44:23 BST

I also had a problem with parsing non .shtm(l) files and found the solution here:

http://my.execpc.com/~keithp/bdlognt.htm#ntparse

Hope this helps anyone who finds this post.

Jim