Alakazam
08-06-2007, 08:35 PM
Have you ever wanted to create your own Error 404 page, but you didn't know how? Well as you will see, it is quite simple and only involves a few lines of code.
First of all, make sure that your server allows .htaccess files. You must also upload in ASCII mode or it won't work, so make sure your FTP program has that.
Ok now it is time to start creating your error pages. You can name them for example 404.html or whatever you want, it is up to you! Now start out by opening a text editor like Notepad and enter the following:
ErrorDocument 403 http://www.yoursite.com/403.html
ErrorDocument 404 http://www.yoursite.com/404.html
ErrorDocument 500 http://www.yoursite.com/500.html
Once you have that entered, go to the menu and click File and then select Save As. Once in there, name the file .htaccess and then select All files from the drop down menu and save it.
Now upload all your your files (.htaccess, 403.html, 404.html, 500.html) in ASCII mode to the base directory of your server. That means the directory that your index page is in, not some folder for your images. If you did everything correctly, it should all work. To test it out, type in a URL that you know doesn't work on your site. If it doesn't work, check over this tutorial to see if you did everything correctly.
First of all, make sure that your server allows .htaccess files. You must also upload in ASCII mode or it won't work, so make sure your FTP program has that.
Ok now it is time to start creating your error pages. You can name them for example 404.html or whatever you want, it is up to you! Now start out by opening a text editor like Notepad and enter the following:
ErrorDocument 403 http://www.yoursite.com/403.html
ErrorDocument 404 http://www.yoursite.com/404.html
ErrorDocument 500 http://www.yoursite.com/500.html
Once you have that entered, go to the menu and click File and then select Save As. Once in there, name the file .htaccess and then select All files from the drop down menu and save it.
Now upload all your your files (.htaccess, 403.html, 404.html, 500.html) in ASCII mode to the base directory of your server. That means the directory that your index page is in, not some folder for your images. If you did everything correctly, it should all work. To test it out, type in a URL that you know doesn't work on your site. If it doesn't work, check over this tutorial to see if you did everything correctly.