Results 1 to 5 of 5

Thread: Trying to build my own 404, 403 and 400 error pages

  1. #1
    Join Date
    Mar 2013
    Beans
    12

    Trying to build my own 404, 403 and 400 error pages

    I'm trying to build my own 404, 403, and 400 error pages. Here is the website where i got the information.
    http://queenofsubtle.com/404/?page_id=2180

    It says: "Create a file called .htaccess in the root directory of the server (the one you refer to as ‘/’) and enter your error handlers in the following format, one per line:"

    I don't understand why they don't just tell you what to do step by step. But is the root directory of the server /etc/apache2?
    at in the etc/apache2/ directory i type sudo nano .htaccess and then type the error handlers he lists?

    where would i create this folder on server root or /var/www?

    /errors/custom404.html


    Is that what i do? Thanks!

  2. #2
    squakie is offline I Ubuntu, Therefore, I Am
    Join Date
    Oct 2012
    Beans
    2,238
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Very Simple Question

    Okay, first off I don't know squat about the server. I did find this which talks about the document root for apache - I don't know if that's the same thing or not.

    As far as the files, from the link you provided it would appear you would put the entries like

    ErrorDocument 404 /errors/custom404.html
    in the .htaccess file (if you follow my link, I think that somewhere in the conf file it will show what your root folder is - and perhaps it is just "?") in the server "/" folder, then define an html file (in the example above, custom404.html in the /errors folder) that contains what you want that page to look like - they named it custom404 since it is a custom page 404).

    It will require a server reboot.

    Don't know if that helps you at all or not.

  3. #3
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    2,108
    Distro
    Ubuntu Development Release

    Re: Very Simple Question

    I would recommend using the ubuntu server guide for this type of information, as it is specific to ubuntu. In the 12.10 guide (pdf) see chapter 11 sub-section 1.2.2, where it says:
    Read /etc/apache2/conf.d/localized-error-pages for detailed instructions for using ErrorDocument, including locations of example files.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  4. #4
    Join Date
    Mar 2013
    Beans
    12

    Re: Very Simple Question

    based on waht the documentation says, looks like i need to read the information here: /etc/apache2/conf.d/localized-error-pages

    I hope that solves it. I'll check it out tomorrow. i thought this would be simple and straight forward.

  5. #5
    Join Date
    Oct 2009
    Location
    Reykjavík, Ísland
    Beans
    10,949
    Distro
    Lubuntu 15.10 Wily Werewolf

    Re: Trying to build my own 404, 403 and 400 error pages

    Changed the title to a more informative one.
    About problems due to upgrading
    Bringing old hardware back to life.
    Please visit Quick Links -> Unanswered Posts

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •