Server Wide 404 Error Ads

Discussion in 'Site & Server Administration' started by hostparlor, Oct 13, 2007.

  1. #1
    Hello, i was wondering if someone would be able to tell me how to edit the 404 error page serverwide. Like hostgator does. I want to place ads on them pages to earn some extra revenue. I still want my clients to be able to change it if they want but the default i want it to be google ads on every site that is installed on the server.
     
    hostparlor, Oct 13, 2007 IP
  2. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #2
    in apache 2.2 you have a global config file
    errors.conf

    and would UN-comment or if missing - add the line:

    ErrorDocument 404 /missing.html

    where you may replace the filename for missing.html by the actually used filename that you plan to let appear in a 404 situation.

    then you CREATE that file - add whatever you want - a good idea always is to add a SITE-search
    since often or most of the missing file errors come from misspelled URLs when ppl hand-type an URL and have misspelling or cAsE-wrong in URL

    re ads on 404 pages
    make sure that procedure complies with current TOS of the ad-server you want to have displayed.

    if you have NO dedicated server - then you have NO access to that apache file, hence you would add the same line into your .htaccess file at domain root level!

    a tip:

    since such a page typically has boring and limited content
    it is a good procedure to SSI a RSS feed that has a spicy and changing content - SSI = NO javascript !!
    hence you make this newsfeed content permanent part of the missing.html page - and get ever changing keywords for relevant ads
     
    hans, Oct 13, 2007 IP
  3. hostparlor

    hostparlor Peon

    Messages:
    521
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you:) i do have a dedicated so this will be good.
     
    hostparlor, Oct 13, 2007 IP