Default Document


#1

Hi,
I’m new to DreamHost and I would like to change my default document from index.htm to index.php. I’m aware that I can do this in the .htaccess file. Were does this file need to be and how can I edit it. Can anyone give me some detailed information as to how to edit the .htaccess file? I use Windows. Thanks.


#2

If you want index.php to be served instead of index.html all you have to do is upload the new php file and ditch the html one. It will now be served.

-Matttail


#3

Alternative Index Files

When a visitor accesses your website, the server checks the folder for an index file. Some examples of common index files are: index.htm, index.html, index.php, index.cgi, index.pl. The supported index files depend on the how the server is set up. If the server cannot find an index file, it will try to display an index of all the files within the current directory, however if this is disabled, the server will end up displaying a 403 forbidden error. Using .htaccess, you can use a completely different index file instead of the defaults listed above. To do this, insert the following line into an .htaccess file:
DirectoryIndex pagename.html

Extended answer on
https://panel.dreamhost.com/kbase/index.cgi?area=3083


#4

Thanks that is an excellent guide and explains what I need to do. I do have one other question about this though, once the .htaccess file is FTP’d to my home directory I don’t see it on the server? How do you get it again so you can edit it?

Thanks.


#5

you have to find settings in your FTP client to show hidden files.

is still confused why you need an htaccess file to serve a php index file… Oh well

-Matttail