Forum Moderators: coopster & phranque

Message Too Old, No Replies

SSI etiquitte

Include all tags?

         

mdharrold

2:17 am on Aug 4, 2001 (gmt 0)

10+ Year Member



When building a menu or header page to be used as an SSI, should you include the <html>, <meta>, <head>, or <body> tags or just start with the code?

Do the browsers care?
Do the spiders care?

Brett_Tabke

11:43 am on Aug 4, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Say this is your file that includes your remote control navigation menu code:

<head><title>foo</title>
<metas...></head>
<body>
<!--#include virtual="/remote.htm" -->
</body>
</html>

Apache just INSERTS the contents of "remote.htm" into the output stream. So...the head section an all tags have already be sent by the first file. SSI includes are just simple "inserts". You can mix and match files at will with any content. What you see in the browser, is just what the server sent.

For example over on search engine world, each page has 6 ssi includes.

1- default header info is built
<!--#include virtual="/cgi-bin/headers.cgi?root"-->

- meta tags inserted here

2- custom title tags
<!--#include virtual="/cgi-bin/top.cgi?subtitle=%3ca%20href%3d%22http://www.searchengineworld.com/misc/%22>Misc</a>%20/%20Cloaking%20Overview"-->

- /head closed and /body opened in 2

3- advertising code insert
<!--#include virtual="/cgi-bin/burst.cgi?richmedia"-->

- bulk of page content output from whatever file we are parsing here.

4- a counter is called
<!--#include virtual="/cgi-bin/cntr.cgi"-->

(often I run two counters, one at top and one at bottom of page to watch for reloads as a sign of server problems.)

5- right side navigation menu is printed
<!--#include virtual="/cgi-bin/menu.cgi"-->

6- finaly, the bottom is printed with copyright..etc, and the html closed out.
<!--#include virtual="/cgi-bin/bottom.cgi"-->

(filenames changed out of self protection)

mdharrold

8:47 pm on Aug 5, 2001 (gmt 0)

10+ Year Member



Brett-
You have'nt seen any problems with the spiders reading this?

Do the spiders care if every SSI page has its own meta and head tags?

grnidone

2:31 am on Aug 6, 2001 (gmt 0)



The spiders do not have a problem reading this. The include is done before the spider gets the page, so you are golden.

The "included" file has only what is needed. If you put meta and head tags on the "included" file, then it might be out of place on the "includer file.

Does that make sense?
-G

mdharrold

12:10 am on Aug 7, 2001 (gmt 0)

10+ Year Member



I completely understand. That is why I asked. I have been using SSI for a few months and noticed that all included pages had meta and head tags and started to wonder if this was causing any problems for the spiders.

Thanks

mivox

12:28 am on Aug 7, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't think of it as an "included page," think of it as an included code snippet...

If you want to include a navigation table, all the SSI source page needs to have is the actual nav table code (from <table> to </table> ). The SSI source page can be a .txt file if you like, or an .html file, etc.

When setting up the SSI includes, ask yourself, "What code would I have to cut & paste to insert this page element directly into my main .html page?" That's exactly the same code you need to have in your SSI source file...

Brett_Tabke

10:37 pm on Aug 21, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



What you see in the browser for source code when you view a page, is just what a spider is going to see. It doesn't matter if there is one or one hundred includes.

Double meta's and head sections isn't something you want on any page. Some se's will have a problem with that part.