Search code examples
htmlapache2http-status-code-404cloud9-ide

Cloud9 custom 404 page


I'm currently using Cloud9 to build a website. Now, I was wondering if I could set my own 404 not found page. I tried using a .htaccess file with the code ErrorDocument 404 /404.html in it. Also, I tried using this command in the commandline at the bottom of the screen, when you run the app (website). Anyone has any suggestions?


Solution

  • The ErrorDocument directive you listed should basically do it. Follow these steps:

    1. Create a file .htaccess in your workspace directory. Contents: ErrorDocument 404 /404.html
    2. Create a file 404.html in your workspace directory. Contents: Hi mom!
    3. Type run-apache2 in the terminal, or use the "Run Project" button if your project is setup to use Apache by default
    4. Ask your mom to open https://workspace-username.c9.io/bla. Watch her reaction.