Question

I want to set www.domain.com to www.domain.com/index.html. How can I do that?

Posted August 27, 2016 3.1k views
DNS

So my site is hosted on Digital Ocean and the problem I am running into is for some reason or another it won't​ load the most recent version of itself into the main home page. But if I type www.domainName.com/index.html, that is the current page. How can I set www.domainName.com equal to www.domainName.com/index.html.

Any help would be greatly appreciated!!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Unless you have another index file like index.htm or index.php that is taking precedence this is likely just a matter of needing to clear your browser cache. If you connect through a corporate or school network or are on certain ISPs it is also possible that the old version of your page is being cached elsewhere. In general I would recommend clearing the browser cache or trying a different browser first to rule that out.

You will want to edit this file:

sudo nano /etc/apache2/mods-enabled/dir.conf

For example. My website is in PHP, so my dir.conf file looks like this:

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

Since you want index.html to be served first, edit your file like this:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
Submit an Answer