OT - Server Side Includes question

A forum for, well, anything really.
Gripes, moans, ideas or just general chit chat. EXCEPT SPAM!!! - Don't just register to post here - IT WILL GET DELETED!!!
Post Reply
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

OT - Server Side Includes question

Post by tepidarium »

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
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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: Select all

<!--#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.
John
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

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...
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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:
John
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

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:
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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.
John
User avatar
fredlongworthhighschool
Mega Advanced
Mega Advanced
Posts: 362
Joined: Fri Jun 27, 2003 11:34 am
Location: Manchester, England.
Contact:

Post by fredlongworthhighschool »

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.
Andy Davis
Web Designer & Smartboard Manager

Fred Longworth High School, Manchester, England.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Either way, Andy, (shtm, shtml) I believe it still has to be mapped into the server so the files get parsed.
John
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

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!
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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!).
John
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

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
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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.
John
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

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!
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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!
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

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
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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.
John
petbadbreath
Beginner
Beginner
Posts: 1
Joined: Tue Aug 08, 2006 4:40 am

Found a link that describes how to configure IIS

Post by petbadbreath »

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
Post Reply