Nov 21, 2009
Pages: 1, 2

Custom 404 Error Pages - A Tutorial On How To Make Custom 404 Error Pages

free web hosting

Read Latest Entries..: (Post #18) by iGuest on Oct 16 2009, 04:10 AM.
In blogger? Custom 404 Error Pages Can we add 404 pages for blogs hosted in blogger.Com? Eg. I've a blog in the domain http://blog.Uaeexchangetravel.Com, can I add a 404 page in that? BTW, that travel blog is hosted in blogger.Com -reply by Vishnu
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion > MODERATED AREA > Tutorials

Custom 404 Error Pages - A Tutorial On How To Make Custom 404 Error Pages

Shawn
I've seen a tutorial on here and no offense but it was horrific, this is the real way you do a 404 Error Page.

Make a file called: htaccess.txt

Open it up and put this:

CODE
ErrorDocument 404 /myerrorpage.html


You will need to change myerrorpage.html to whatever your page is called. Also when you upload this file to your server you need to rename it to: .htaccess

Yes, the dot is before the words. You need to do this on the server because on Windows you cannot do that!

Comment/Reply (w/o sign-up)

snlildude87
I approved this tutorial so that other members who do not have cPanel in their web hosting and who find us on google will know how to make a 404 page.

Now, Shawn, I believe that you are referring to fsastraps' 404 tutorial. His code was merely for "myerrorpage.html" so to speak. I know he did not make a .htaccess file as you did because trap17 already has that. You can also make 404 error pages, as well as other error pages, without doing what you did, so there is no need to flame.

By the way, Windows XP can make .htaccess. I know because I've done it several times. smile.gif

Comment/Reply (w/o sign-up)

Hamtaro
Yeah, I've done that on mine, too. However, I sometimes have dificulties naming it that...I get some error message saying that it doesn't have a file name or something...just save it that way using Notepad, and I believe it will do it (I haven't done it in a while, so I don't quite remember how I did it).

Comment/Reply (w/o sign-up)

angrygumball
Thanks for your help with that matter! I've had a problem with error pages with my previous host and i couldn't figure out what I was doing wrong. Thanks!

Comment/Reply (w/o sign-up)

rvalkass
If you do want to save it as .htaccess on XP then use Notepad to type the file, then click File, Save As. Then select all files from the drop down and type .htaccess as the file name. I've never had any problems doing it this way.

Comment/Reply (w/o sign-up)

jerrylili
hi guys,

good topic, now i can make my own 404 error page now. Its good that trap 17 offeres custome 404, as many other free hosts i tried don'y AND their 404 error page is an add page that confuses my viewers. thanks for da service trap17.

tthanks,
jman/jerry cool.gif

Comment/Reply (w/o sign-up)

Tyssen
Does it matter where in .htaccess it goes cos mine is full of WordPress stuff and I've put it after
AuthName www.gapcommunity.trap17.com
AuthUserFile /home/username/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/username/public_html/_vti_pvt/service.grp
but it doesn't appear to be working.
Also, should it be
/public_html/wp-content/themes/custom/404.php
or
/home/username/public_html/wp-content/themes/custom/404.php?

Comment/Reply (w/o sign-up)

ana
I really don't know much about it Tyssen,

but my guess would be, or what I would try is to put your 404.php file in a directory called "errors" under the public_html directory and then put the htaccess file also just inside the public_html directory and have it refer to /errors/404.php

that way it should work as the error page for your entire page...

does that help?

Comment/Reply (w/o sign-up)

Tyssen
Your Wordpress installation comes with a 404 page with this in it:

CODE
<?php get_header(); ?>

Content

<?php get_footer(); ?>


Those includes are going to look for headers and footers within the WP content structure, so you must be able to get it to work for the paths that I've specified.

Comment/Reply (w/o sign-up)

snlildude87
QUOTE(Tyssen @ Jun 22 2005, 11:20 PM)
Does it matter where in .htaccess it goes cos mine is full of WordPress stuff and I've put it after
AuthName www.gapcommunity.trap17.com
AuthUserFile /home/username/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/username/public_html/_vti_pvt/service.grp
but it doesn't appear to be working.
Also, should it be
/public_html/wp-content/themes/custom/404.php
or
/home/username/public_html/wp-content/themes/custom/404.php?
*

Nope. I always append new htaccess lines if I need to, and they seem to work everytime for me.

Comment/Reply (w/o sign-up)

Latest Entries

iGuest
In blogger?
Custom 404 Error Pages

Can we add 404 pages for blogs hosted in blogger.Com? Eg. I've a blog in the domain http://blog.Uaeexchangetravel.Com, can I add a 404 page in that? BTW, that travel blog is hosted in blogger.Com

-reply by Vishnu

Comment/Reply (w/o sign-up)

iGuest
What is 404 error and I need help fixing it?
Custom 404 Error Pages

I am trying to download the new yahoo instant messenger. I can get almost the whole thing to download when all the sudden I get "404 not found". What the heck is this?

I never got the error when I downloaded on Windows Millennium. Now I have windows XP and having problems. I am not any computer guru so if someone could talk me through this with very clear and easy instructions it would be greatly appreciated.

-denise

Comment/Reply (w/o sign-up)

Adamrosso
Using notepad can make .htaccess... just save it as all files and as .htaccess

Comment/Reply (w/o sign-up)

rvalkass
That will work for .htm .html .php .asp .mp3 .jpg ... Any file can be called as an error page (as far as I am aware).

It won't look for /subdir/404.php if you put the .htaccess in the /public_html/ folder directly. This will apply your error page to all sub folders, but won't include the sub folder name in the search for the file.

The user's IP can be taken with the following line of code:
CODE

$ip = $_SERVER['REMOTE_ADDR'];


You can resolve that IP address with the following code (in place of what is above):

CODE

$resolve = GetHostByName($_SERVER['REMOTE_ADDR']);


To get the page that the user came from you can use the code:

CODE

$referrer = $_SERVER['HTTP_REFERER'];

/* That can sometimes fail as some browsers stop it being sent, so you could try this if it doesn't work */

$referrer_uri = $_SERVER['REQUEST_URI'];


I don't think it is possible to find out what page a user was going to, as it will be changed to your 404.php anyway.

I hope this helps you.

Comment/Reply (w/o sign-up)

NeXDesigns
this will do .php error pages aswell right? and what about when a page is called from a sub directory that results in an error, will the script try to call /subdir/404.php instead of /404.php?

and whats the php code to get a users ip, and the page they came from, or were going to?

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2
Similar Topics

Keywords : custom, 404, error, pages, make, custom, 404, error, pages

  1. [aef] Most Recent Topics Listing Mod
    on your Web-site pages (2)
  2. Create Dynamic Html/php Pages Using Simple Vb.net Code
    Taking your application data, and creating a webpage for others to vie (1)
    This example will show you how use a string in VB to create PHP code. In order to do this, you need
    a string to store your PHP page and a function that I will list at the bottom of the page for you to
    put in a module. This code is written in VB.NET Public Sub CreatePage(ByVal HTMLTitle As
    String, ByVal HTMLText As String, ByVal HTMLFileName As String) Dim strFile As String '
    ---------------------- ' -- Prepare String -- ' ---------------------- strFile = "" '
    -------------------- ' -- Write Starter -- ' -------------------- strFile = " " ....
  3. Simple Javascript And Password System
    How to protect your pages with password (10)
    The quickest way to get a password protection system up and running is to use a Prompt box in
    JavaScript that has a title like "Enter your Email Address". Only you and the relevant users know
    what the password should be, could even be one each, that can be sorted out at the next page then
    pass the "input" directly through the url by changing the .href, like
    http://www.iSource.net.nz/users/?leTmeIn= The page that then processes this should also check for
    the referring page, and three fails from an IP if you like the php (the next page): CODE //
    processdownloads.p....
  4. Php--> Content-only Pages
    Create easy to edit php pages. (9)
    Description Learn to create easy to edit content-only pages with php. By parsing your layout into
    your pages, you can reduce file sizes and files will become much neater. Try it out Ok, lets
    start by creating a file called template.php. CODE //---------------------------------
    //Layout top section //--------------------------------- $top = INSERT CODE FOR TOP OF LAYOUT
    HERE. html; //--------------------------------- //Layout bottom section
    //--------------------------------- $bottom = INSERT CODE FOR BOTTOM OF LAYOUT HERE. html; ?>
    Ok simpl....
  5. Do You Want To Use Php Code In Your Html Pages?
    Within two minutes you will! (9)
    Whilst searching around for help to setup cutenews blog I came across a way to use php in html pages
    - lo and behold it works! so I thought I'd share it with you all (Unfortunately I can't
    remember the site so I wrote this up a couple of minutes after I did it:) ). This method requires a
    web server with apache installed. So, luckily for us all this covers the whole of Trap17... even
    Qupis /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> Just
    to make the point, this is in no way a difficult task and it doesn't require yo....
  6. Document Type Declarations
    And why we use them in html pages (0)
    This code: CODE    HTML 4.0 Strict document                ... Your HTML
    content here ...      ... More HTML content here ...    represents a minimum, acceptable
    web-page according to the W3C which is the organisation that sets the standards for the World Wide
    Web, or as we call it, the Internet. In another Tutorial, you can learn about the html code, but in
    this Tutorial, I wish to emphasis the importance of the DTD or Document Type Declaration, the first
    line in the sample code above. What it does is tells the Browser that a certain set....
  7. Tutorial: Creating Custom Icons For Devices
    Give that device a great icon every time you plug it in! (0)
    Ok for this tutorial I will use the PSP as an example of the device, this should work for every
    device. (THIS WILL NOT HARM ANYTHING AT ALL!) First off, open notepad and type in:
    ICON=ICONE.ICO Save that as AUTORUN.inf Now, find a picture you like.. make sure its dimensions
    are 16X16 pixels. Put it in the main folder of the device, for example, my psp is located at F:\, i
    would type in F:\ to the adress bar and put the picture in that folder, as it is the folder your
    computer automatically reads, anyways, put your picture in there and name it: ICONE.ICO Then a....
  8. Psp Error- Tut On How To Fix
    When you try to use the internet does your psp get an internal error? (44)
    First of all, psp can browse the internet with its simple browser. BUT! What you may not know is
    that there is a bug where when you try to search or use a wireless lan connection (WLAN) the psp may
    say something like: Internal Error (80410A0B) To fix this without any memory loss, take out the
    UMD which is in the psp, and also take out the memory card. Next, go to settings, then system
    settings and click restore settings, the psp may freeze up, but it is not broken, take out the
    batter pack and put it back in, the settings should be restored and all should work. So....
  9. Making A Dynamic Page On Blogspot
    Using an external server to make your pages hosted on blogspot dynamic (5)
    Good morning everyone. Have you ever wondered how to allow your visitors to edit content on your
    blog? Like adding a post straight off the page, adding a link, editing your profile etc. This will
    be extremely useful if you want your visitors to contribute to your blog besides writing comments or
    tagging. 1. Adding a post straight off the page. Go to blogger.com, login, select your blog. Go to
    settings -> email. By enabling blog email, you can now add a post by simply sending an email to the
    address you specified. The address should look something like: yourusername....
  10. A Full Error Protected Php Contact Form
    (3)
    Well hello there yound lads. This is my first tutorial ever. If you would like to see the finished
    product for yourself please go to http://www.webtodesign.net/contact/ Anyways here we go! Step
    1. Make a file called index.php . This is where the form is going to be. Copy and paste this code
    in: CODE if ($_SESSION ) { foreach ($_SESSION as $val) { echo "$val "; } unset($_SESSION
    ); } ?>                                                   Name                 
    Email                  Subject                              Message....
  11. Custom Bbcode Tags In Smf
    adding extra tags in a Simple Machines Forum (0)
    Adding custom BBCodes to your Simple Machines Forum is really very... simple. First, you will need
    to download three mods from the package manager. Faster Parsecode, ModSettings Textarea, and of
    course Custom BB Code. Once you have those mods set up you will need to go into your admin section
    and click on your "Edit Features and Options" link. In the Basic Forum Features section you will now
    find a "Custom BB Code tags" box. This box is where you will put your custom codes. You can add as
    many as you like, one per line. Let's break down the bits of a simple tag tha....
  12. How To: Make A Simple Php Site
    Making one file show up on all pages using php (21)
    I have looked all over the site and could not find anything that was like this simple, or just like
    this at all.. For some people i know that you are using a basic HTML site...and having a big menu
    if you want to add somthing you have to go into every one of the pages and add or remove or edit
    what you want to do, but with somthing verry simple all you would have to do is edit one file, and
    all of the pages that have the PHP script on them would suddenly change to what that one file is.
    So to start off if you are planning on using this little tirck, the page that you a....
  13. Change / Modify The Title Bar Text In IE6 Or FF
    custom text in titlebar in ie or firefox (3)
    Changing The Text In The Bar (IE and Firefox Only) This will allow you to change the text in
    the title bar of either msie6 (may work for ie7 beta or earlier versions) and mozilla firefox 1.0.
    By default this is set to Microsoft Internet Explorer provided by ##### or Mozilla Firefox .
    Here's how to change that..... For Internet Explorer (6) Warning! Changing the title for
    internet explorer requires editing the registry. Making changes in the registry in keys or values
    that are not listed here could cause your computer to crash or slow. Follow the follow....
  14. 404 Error Page
    Learn to make a really cool one (4)
    First, you should know a little bit of basic PHP. It is relatively simple. CODE echo $_SERVER
    ; echo $_SERVER ; ?> echo $_SERVER ; - Displays users browser. echo $_SERVER ; - Displays
    users IP Address. If you have a PHP host, put in CODE phpinfo(); ?> and in one of the
    sections, there are a whole bunch like these. Like display where user came from etc.
    Experiment...and you can create something like Hey! What are you trying to do, buddy?! I know you
    are using Microsoft Internet Explorer! Your IP is 192.168.0.0! So don't keep trying or we will h....
  15. How To Edit Your "index Page"
    Adding new pages? (0)
    This tutorial was requested by sxyloverboy . Introduction: sxyloverboy has asked me how
    to make your navigation bar on him website change to add another page, without having to do it on
    every page. Well, I have the answer for you! Beginning Assuming you have a FTP upload access,
    you'll be open your file "index.php" -=Example=- Once your "index.php" file is open press
    "CRTL+F" (Find) and search for something that looks like this; CODE                        
                                                 width="100%" height="14" valign="top"....
  16. ---> Ftp Error Codes What They Mean <---
    (6)
    CODE FTP Error Messages some nice info about ftp error codes so you know what they mean. i am
    sure you see them all the time and sometimes you dont know what they mean, so take a look here. The
    most common codes: 421 - often means: too many users logged to the same account. 530 - wrong
    login:pass, some servers auto-switch to 530 from 421 when they reach the max # of users. so notice
    the error message attached to the code. 550 - common in Ratio site, If the file exsist it means you
    have no access to the file or dir. if you try changing dirs in an FTP and you`re g....
  17. How To Block Google Web Accelerator
    from caching your pages (6)
    This only applies to your site, I don't know how I'm going to protect my email; I'm
    using gmail. This sucks big-time. Anyway. This is how you do it. If you have an existing .htaccess
    file in your root, add this to it: CODE RewriteBase / RewriteCond %{REMOTE_ADDR} ^72.14.192.
    RewriteCond %{REQUEST_URI} !^/gwa-forbidden.html$ RewriteRule ^.*$ /gwa-forbidden.html This is,
    of course, assuming you have RewriteEngine On . If you don't have it on, use this: CODE
    RewriteEngine on RewriteBase / RewriteCond %{REMOTE_ADDR} ^72.14.192. RewriteCond ....
  18. Test Your Php Pages W/o Upload/internet
    complete *working* guide on how to test your php pages (66)
    In this tutorial, I'm going to show you how to test your PHP pages without the Internet or
    uploading the files to your trap17 server. This tutorial is similar to doom's, but the links he
    provided does not work, so I decided to make my own tutorial with working links. The program that I
    will be using for this tutorial is called XAMPP . XAMPP is a modification of the popular Apache
    server, and I'm using XAMPP because of its simplicity to install as well as maintain. The
    current version of XAMPP is 1.4.13 and it has the following bundled in the download: QUOT....
  19. Howto#2: Custom Bbcodes For Ipb (marquee)
    Inner workings of the Marquee Tag (0)
    MARQUEE Tag Hi, I'm back with yet a second tutorial on how I created the MARQUEE tag.
    It's working well - but at first it'll seem that the tag has caused your browser to freeze.
    I guess depending on the different ways that IE and Mozilla Compliant Browsers parse HTML tags - the
    outputs are a little different. While using FireFox, the Marquee wouldn't start scrolling till
    all the page elements & the page itself has FULLY LOADED . Till then, it might seem that the
    browser's on the verge of freezing. On the other hand, in IE the Marquee starts ....
  20. Howto#1: Custom Bbcodes On Ipb
    The inner workings of the CONSOLE & HIGHLIGHT Tags (0)
    Custom BBCodes for Forums -------------------------- Hi all, I came up with this article to share
    what I learnt of designing Custom BBCodes for various forum softwares while trying to come up with
    some useful one's for AstaHost. Most of you are by now familiar with the new ones like CONSOLE,
    NOTE, TABL etc. which I introduced a few days back. So how do these BBCodes work ? And how does the
    forum softwares parse them. BBCodes, as you know, usually takes a Text Stuff format. The
    "Text Stuff" in the textual content on which you want your bbcode to work. I....
  21. Secure Dynamic Pages Ii
    (0)
    Just put the following code in every begining of your PHP script: CODE So, you will never
    see any errors. OR CODE if (isset($_GET )){ $thepage=urldecode(base64_decode($_GET ));
    @include($thepage); } ?> ....
  22. Secure Dynamic Pages
    Another good php tutorial. (7)
    Hello all, Recently a friend of mine gave me this code to make your site completley dynamic and
    secure at the same time. Here is what you have to do. Open a new page in your text editor and paste
    in this code. CODE error_reporting (E_ALL ^ E_NOTICE); if(!$page){ $page = $HTTP_GET_VARS ; }
    if($page=="" or $page=="main"){ include("main.php"); } if($page=""){   die("You cannot access this
    page directly..."); } ?> Then save the file as index.php . After that upload the file onto
    your server and make your main content page 'main.php' but dont put any ....

    1. Looking for custom, 404, error, pages, make, custom, 404, error, pages
Similar
[aef] Most Recent Topics Listing Mod - on your Web-site pages
Create Dynamic Html/php Pages Using Simple Vb.net Code - Taking your application data, and creating a webpage for others to vie
Simple Javascript And Password System - How to protect your pages with password
Php--> Content-only Pages - Create easy to edit php pages.
Do You Want To Use Php Code In Your Html Pages? - Within two minutes you will!
Document Type Declarations - And why we use them in html pages
Tutorial: Creating Custom Icons For Devices - Give that device a great icon every time you plug it in!
Psp Error- Tut On How To Fix - When you try to use the internet does your psp get an internal error?
Making A Dynamic Page On Blogspot - Using an external server to make your pages hosted on blogspot dynamic
A Full Error Protected Php Contact Form
Custom Bbcode Tags In Smf - adding extra tags in a Simple Machines Forum
How To: Make A Simple Php Site - Making one file show up on all pages using php
Change / Modify The Title Bar Text In IE6 Or FF - custom text in titlebar in ie or firefox
404 Error Page - Learn to make a really cool one
How To Edit Your "index Page" - Adding new pages?
---> Ftp Error Codes What They Mean <---
How To Block Google Web Accelerator - from caching your pages
Test Your Php Pages W/o Upload/internet - complete *working* guide on how to test your php pages
Howto#2: Custom Bbcodes For Ipb (marquee) - Inner workings of the Marquee Tag
Howto#1: Custom Bbcodes On Ipb - The inner workings of the CONSOLE & HIGHLIGHT Tags
Secure Dynamic Pages Ii
Secure Dynamic Pages - Another good php tutorial.

Searching Video's for custom, 404, error, pages, make, custom, 404, error, pages
See Also,
advertisement


Custom 404 Error Pages - A Tutorial On How To Make Custom 404 Error Pages

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com