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 trialtako izu
17,645 PointsHow 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
231,172 PointsIt 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
17,645 Pointstako izu
17,645 Pointsthis is what the workspace looks like https://w.trhou.se/6mkeznxecs
Steven Parker
231,172 PointsSteven Parker
231,172 PointsThis 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.