Forum Moderators: phranque

Message Too Old, No Replies

Proper way set up index/home page

         

lleemon

6:01 pm on Oct 5, 2006 (gmt 0)

10+ Year Member



I am working on a site that has a index.html and index.shtml, index.cfm, and other .shtml and .cfm pages.

In IIS in the domain properties, under Documents tab is a list of pages. The list is as follows:
index.html
index.shtml
index.cfm
index.htm
Default.htm

If I go to a Search Engine Spider Simulator page and enter the base domain it brings back nothing. All other .shtml pages do show meta and other text.

I am wondering if it's because index.html is as follows:


<HEAD>
<SCRIPT LANGUAGE="JavaScript">
redirTime = "0";
redirURL = "index.shtml";
function redirTimer() { self.setTimeout("self.location.href = redirURL;"); }
</script>
<BODY onLoad="redirTimer()">

Wouldn't it be best to just move index.shtml and it be the default page displayed? Also, do you think this is why a spider may not see any meta tag data or body text?

Thanks in advance.

jtara

8:25 pm on Oct 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why do you have your index.html set up like that?

Simply delete index.html. Your web server will use the next index on the list - index.shtml.

There are two possible issues:

1. If you have internal links on your site, make sure they reference just the directory, not index.html.

2. Sometimes others will assume that there is an index.html. If somebody creates a link manually, they might tack-on "index.html" for your home page. I suppose some idiot might type it into the browser, but that's less likely.

There's no reason for index.htm and Default.htm, unless you are creating pages with some editor that refuses to create files with extensions longer than 3 characters. That would be an editor that's 10 years old, so it's not likely. If you have such files, simply rename them with .html.

It's useful to understand just what is going on here. It's pretty simple. When a user requests example.com/ the server goes down the list of potential index files. It will serve the first one it finds. If it doesn't find any, it will return an actual index of the files in the directory (if you have that feature enabled).

So, when a client request example.com/, first the server sees if there's an index.html. If there isn't it sees if there is an index.shtml, etc. This works on subdirectories as well, of course.

You can see, then, why there's no point in having an index.html that simply redirects to index.shtml.

I'm unfamilar with IIS, but with Apache running under Linux there is no need for .shtml files. You can mark a file as one that requires SSI (server-side include) processing by setting the file's "executable" bit. It's a trick the Apache server uses on Linux.

There may be a similar shortcut for IIS.

That IS why you have an .shtml file, right? :) (That is, you are using server-side includes?)

If you AREN'T using server-side includes, then, yes: simply delete index.html, then rename index.shtml to index.html.