PDA

View Full Version : Server side Includes in default page



raj74
11-24-2003, 12:07 AM
Hi guys,

I am using server side includes for header and footer and left menus on my current website.The problem is the default page for hosting the site with my webhost should be default.html so i have to design a seperate default.html page without any server side include.

If i want to change header i have to change in two places like default.html and header.inc.

Is there any way to include the header and footer in the default pages?

thanks in advance
raj

cyanide
11-24-2003, 10:13 AM
If you are allowed to use .htaccess, you can put this:
DirectoryIndex index.shtml default.shtml
This will change which page you can use as your index page

The other option is that you can really have the index page look almost like a cover page by not having it look like all the other pages.

spiderbait
11-24-2003, 10:24 AM
this is just a quick and dirty explanation, and it has some downsides, but it may help.

You can have any page contain ssi if you have access to your .htaccess file. For example to add .html files you would add this to your .htaccess file:

Options Includes +ExecCGI
AddType text/x-server-parsed-html .html

of course, if you do that your server will have to parse every .html page it serves looking for requested includes. If you've got a small site it's no biggie, but if you've got a large one with a lot of traffic it may not be desirable.

if you want .htm files to have includes you would write it this way:

Options Includes +ExecCGI
AddType text/x-server-parsed-html .htm

pretty straightforward really.