Index.html default?

They have: 238 posts

Joined: May 2002

I would acually like to know if its possible to go to another page instead of index.html, ie splash.html, when my site is accessed? If you know, I'll pass it on to my host, his server..

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Yes, your host can set the page to be anything he pleases.

Or you can, with the DirectoryIndex command in your .htaccess file.

Smiling S

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

In an .htaccess file (assuming that your host in running apache), the
statement as Suzanne mentioned is:

<?php
DirectoryIndex index
.html index.htm index.php splash.html
?>

It looks for the first file listed, then the second if the first is not found, on down the list.

Of course, the big question is why not just rename your file from splash.html to index.html.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

I can answer that one, Mark. I have a script that I'm using from a third part that has the main page called photos.php. But it's in its own folder. I don't want to have to go in and figure out all the ways to fix the url in the script, so I just used a DirectoryIndex.

I also used it to fix a badly written site for a client without having to break all the urls, and more than once to make index.php work when I couldn't get the server admin to wake up and set index.php as a default page/extension in the httpd-conf file, and the site was showing the contents of a directory rather than the index.php file.

Smiling S

They have: 238 posts

Joined: May 2002

Thanks for you feedback! Smiling

Also, Is it possible just to type in extensions with the directory index command, i.e: .htm .html .shtml .php ?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

no, that's a different function, either the event handler or mime type (depending on what you want to do).

What are you wanting to do?

They have: 238 posts

Joined: May 2002

I'll just use the DirectoryIndex command, thanks anyway.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.