Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: jroul on May 17, 2005, 12:30:43 AM

Title: How do i change the index.html
Post by: jroul on May 17, 2005, 12:30:43 AM
I want to have the default page default.php, but it only looks for index.html
Title: How do i change the index.html
Post by: nigeltodd on May 17, 2005, 05:07:34 AM
i believe you have to use 'index.php', as a browser will search for all instanmces of index.*.
Title: How do i change the index.html
Post by: arne on May 18, 2005, 02:19:06 AM
No, I'm rather sure you can define default.htm as a "starting" or indexing page as well.

You can try it by just opening the httpd configuration file and then just edit the line that define the index.html as start index. Just add default.htm in this line and it will work.

Just because the sme server is a sme server this will just work for a time. The automatic configuration routines will write over your manual changes after a while.

Then you have to find the right template frafment and edit this "the sme way" to make it a permanent change.

This is not really difficult, it just takes a little bit time to find the documentation about template changes and then to do the changes.

To set up a sme server is very quick and easy, but changes like this is a little bit more time consuming than most other Linux distroes.

First you have to identify the required changes in the configuration file, and then eventually try out that.

Then you have to identify the right teplate fragment, copy it over to the folder for modified template fragments, and then do the changes there.
Title: easier way
Post by: treyh on May 18, 2005, 05:43:45 AM
:hammer:

I'm not trying to be disrespectful or rude but there is an easy fix for this. Simply don't use index.html for the name of one of your pages.

Another easy fix is to leave all your PHP in the html directory but make a new directory called htm where all your *.htm and *.html files are stored. This would take longer but I've done this before.

Making a simple change will eliminate a lot of problems.
Title: How do i change the index.html
Post by: funkusmunkus on May 18, 2005, 06:04:31 AM
The order works like this
Code: [Select]
DirectoryIndex index.htm index.html index.shtml index.cgi index.php index.php3 index.phtml
so if you change it from default to index.php and delete the index.htm/htm it will default to index.php

hope that helps
cheers
Title: How do i change the index.html
Post by: arne on May 18, 2005, 01:48:19 PM
"You can try it by just opening the httpd configuration file and then just edit the line that define the index.html as start index. Just add default.htm in this line and it will work."

I think the result of this on a Sme server is a "open directory listing". It will work, but not in the way as intended. The default.htm file will not work as a DirectoryIndex file unless specified as this.

"DirectoryIndex index.htm index.html index.shtml index.cgi index.php index.php3 index.phtml"

This is the right place in the configuration file where the "default.htm" string should apear.

On quite many or most Linux distributions without a automatic configuration tool editing this line will work ok.

For the Sme server the situation is a little bit different bacause it has a automatic template system that will write over the configuratin file from time to time. So the changes you make by editing will work for a shorter or longer time, but it will not be permanent.

Because of the template based configuration of the Sme server the only way to make a permanent and properly working modififation of the DirectoryIndex string is to modify it via the "system" for template fragment modifications.

This is just how it works, good for stability and system integration, not so food for easy and quick modifications .. But not very difficult if you find the documentation for template modifications, use some time on it the first times, and do it the proper way.
Title: How do i change the index.html
Post by: arne on May 18, 2005, 01:59:35 PM
The file that should be changed via the template fragment modification is tis one:

/etc/httpd/conf/httpd.conf

The line in this file that should be modied via template fragment modification is this one:

"DirectoryIndex index.htm index.html index.shtml index.cgi index.php index.php3 index.phtml"

How to do template fragment modifications is described here:

http://no.longer.valid/phpwiki/index.php/Customizing

Only this method will work proporly in the long run on a Sme server.
Title: How do i change the index.html
Post by: CharlieBrady on May 18, 2005, 02:27:51 PM
Quote from: "arne"

Only this method will work proporly in the long run on a Sme server.


Sure, but by far the easiest is to use index.php rather than default.php.