Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Joshua Holland
Joshua Holland
2,865 Points

url directing

Hey guys. I just purchased my domain name from namescheap.com and my webhosting from webhostingforstudents.com. I was emailed my nameservers, FTP address, SFTP port, username and password. I used the cyberduck software to upload this information.

When I visit my domain which is hfaband.com I am being directed to an index which contains all of my files. I know there can be a wait time from when you transfer your domain to webhosting although it appears that my other pages are active because when I click on one from the index I can access it and navigate to other pages. I'm just not sure why my home page is not working.

does anyone have any insight as to why this may be happening and how I can fix it? Thanks in advance!

3 Answers

Sidney François
Sidney François
2,092 Points

My best guess would be to rename the Index.html to index.html.

At least that's the standard convention. (File names in general should be lowercase.)

Joshua Holland
Joshua Holland
2,865 Points

That worked, thank you SO much! I'm learning quickly that everything in coding is VERY specific. Can't believe one case sensitive letter prevented the whole site from working :P Thanks again!

Amber Cookman
Amber Cookman
12,662 Points

Yeah, I think Sidney is right.

I found this which says "When someone goes to your site using only the domain name and not specifying a specific page, Apache looks for an index file to use. If Apache can't find the index file (e.g. index.html, index.htm, index.php, etc.), it attempts to show a directory listing instead. If directory listings are disabled, it will return a forbidden error." So my guess is that if Apache doesn't have Index.html (with the uppercase i) specifically listed as an option in addition to index.html, it just skipped right over the file.

Computer languages are often very case sensitive. :)

Joshua Holland
Joshua Holland
2,865 Points

Okay so now I am encountering a bit of a different problem. Changing "Index" to "index" made the site accessible, however if I go to another page and then try to click on home I am getting a URL not found. So from what you are saying Amber, I need both an "Index" and "index" file? How do I do that?

Joshua Holland
Joshua Holland
2,865 Points

I actually think I fixed it. I had Index capitalized in a couple other places in my code. My workspace preview is now working but when I use cyberduck to upload the new files and visit the actual website I am having the same problems. Is there a slight delay between uploading new files and the changes being reflected on the website?

Sidney François
Sidney François
2,092 Points

Most definitely. Uploading via FTP (at least for me) means a delay of about 10 seconds until it shows on the website. Plus, if you don't "hard-refresh" (SHIFT + CMD + R) your browser might display a cached version of your website.

And yes, everything in coding is very specific. HTML isn't even that bad. When you get things messed up in programming languages (JS, PHP, etc.) your complete website/server might stop working. So, if you're not methodical about your coding, you're going to have a bad time maintaining your code. :)