Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Sharing a Website Upload the Website

Home page publishing at /index.html not www.myaddress.com

In the video, the index.html file publishes as the home page. When I do it, it publishes at www.myaddress.com/index.html. And at www.myaddress.com still shows

"Index of /

Index.html

Apache/2.2.24 (Unix) mod_hive/3.6 mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_fcgid/2.3.6 Server at ..."

WHAT HAVE I DONE WRONG? I want my index.html file to display at www.myaddress.com, surely

4 Answers

Jeremy Germenis
Jeremy Germenis
29,854 Points

you could just remove it using your .htaccess file:

RewriteEngine On

RewriteCond %{REQUEST_URI} index.html

RewriteRule ^(.*)index.html$ /$1/ [R=301,L]

Jeremy,

Thank you. Actually, I'm a rank amateur here. Are you saying I splice:


RewriteEngine On

RewriteCond %{REQUEST_URI} index.html

RewriteRule ^(.*)index.html$ /$1/ [R=301,L]


into my code and my index file will be published at www.myaddrtess.com?

I can see we are an advanced programmer.

Jeremy Germenis
Jeremy Germenis
29,854 Points

download the .htaccess file from your hosting server or create the file (it's just a plain text document), and put these three line in it and upload it to your main website directory

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hi Kenelm Tonkin,

In your original post, it looks like your file Index.html might be capitalized. Usually this shouldn't matter, but trying changing the filename to all lowercase "index.html" and see if that fixes it. Otherwise, it's likely a server configuration issue as Jeremy Germenis pointed out.