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

General Discussion

tako izu
tako izu
16,012 Points

How do I make an error 404 page in treehouse workspaces

I'm trying a method where you create a .htaccess file and then run it in the root directory, but it doesn't look like Treehouse Workspaces support .htaccess files. This is what I'm trying to put in the file:

ErrorDocument 404 /unknown.html

Is there another way that I can make a 404 error page when a user types in an unknown URL?

1 Answer

Steven Parker
Steven Parker
229,644 Points

It works fine for me, maybe there's something odd about the workspace organization.

Take a look at this video about sharing a snapshot of your workspace.

tako izu
tako izu
16,012 Points

this is what the workspace looks like https://w.trhou.se/6mkeznxecs

Steven Parker
Steven Parker
229,644 Points

This workspace has no .htaccess file, but after I added one with your intended content the custom error page was successfully served when I tried to access a non-existent location.

Note that the built-in workspace editor doesn't recognize the type of a file with that name, but you can use it to create a text file and then rename it.

Oddly, the workspace did have a file named fourzerofour.htaccess, but it was empty and that's not the correct name.