How do point to Homepage different than index.html


#1

Hi all,
I do not call my homepage index.html or any other automatically found title. I use a totally custom filename. I have had the same name for several years, but now I want to change it and I don’t know how to in the Dreamhost panel.

Basically, how do I point my domain to load my own filename instead of the usual index.html?


#2

You can use the DirectoryIndex directive in .htaccess:

http://wiki.dreamhost.com/KB_/Sign_Up/Infrastructure/Software/_Apache

The DirectoryIndex command lists all the files Apache should look for (in order) to determine what to display when somebody goes to a URL for a directory. That is, it’s the default file name for your web site. Ours is set to:

DirectoryIndex index.html index.shtml index.htm Index.html Index.htm Index.shtml default.htm Default.htm default.html Default.html default.shtml Default.shtml page1.html index.pl index.cgi index.php index.php3 index.phtml home.htm home.html home.shtml index.wml

As long as you name your “index” file any one of those things, it will work!

If you have two files with names from that list, Apache will show the one that shows up first (e.g. index.html will show up, even if you have an index.php file in the same directory).

You can change your own DirectoryIndex setting to be anything you’d like via an .htaccess file too!

–rlparker
–DreamHost Tech Support


#3

I apologize. I should have been more specific in my question. My current Home Page file, for example, is:

robobugs-r-c.html

I want to redirect or something and change this to load the following Home Page filename:

robobugs-radio-control-home.html

I believe that when I first started using Dreamhost, I set the current filename to be the Home (like index). Now I would like to change it to load the new filename.

Thank you for your help!
Mike


#4

You could use a rewrite in your .htaccess. This might be useful for supporting spidered links from search engines. Once they come to recognize “robobugs-r-c.html” as having content, it will show up in search results. A redirect would be counter-productive and is likely to get the page dropped from the search results.

You could put this in your .htaccess file:

RewriteEngine On
RewriteRule ^robobugs-r-c.html /robobugs-radio-control-home.html


#5

redirects are actually handled fine by search engines, provided you do it with http headers instead of javascript or the refresh header / meta tag. since you don’t need regular expressions, do this in .htaccess:

RedirectPermanent /robobugs-r-c.html http://www.example.com/robobugs-radio-control-home.html

when the server gets a request for robobugs-r-c.html, it responds saying that it’s been permanently moved to http://www.example.com/robobugs-radio-control-home.html and the requester should look for it there instead. google understands this and migrates the data it had on the old url to the new url.

the difference to people visiting robobugs-r-c.html is that the redirect will actually end up showing robobugs-radio-control-home.html in the address bar but the rewrite will still show robobugs-r-c.html and make it look like you have the exact same content at both.

track7 - my dream-hosted site


#6

I was thinking that the OP would want to periodically change the actual loaded page rather than this one time change. misterhaan hit the nail on the head if this is instead a permanent redirect.


#7

I always access my default index files by the directory name alone, and when linking back to the home page from another file in the same directory I use A HREF="./" instead of naming the file there; it makes for shorter and cleaner looking URLs, and if for some reason I were to change the filename of the default index (changing the configuration accordingly), I wouldn’t need to redirect any existing links.

– Dan