Home | Articles|Namespace|Interview Questions|Tools|Jobs|Projects|Community
Asp.net Tutorials

»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books

»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects

»Competition
Community
Winners
Prizes
Write For Us
Members

»Other Resources
Links
Dotnet Resources

Creating Custom Error Pages with .htaccess

Have you ever noticed that some people have really nice error
pages when a page doesn't exist on their site? Wouldn't it be
nice if you could make your error page match the rest of your
site? Don't fret; you can do it! All you'll need to do is use a
handly little file called .htaccess.



First thing you need to know is that .htaccess is a very
powerful file that controls a lot of important parts of your
site. Before you change anything, make sure to make a backup
copy. If anything goes wrong, you can revert to the backup. If
there isn't already an .htaccess file on your server, you can
create one in Windows Notepad or your favorite HTML editor. If
you're using Windows, make sure you save the file as ".htaccess"
including the quote marks.



Next, you need to little bit about HTTP response codes. What are
those, you ask? Well, any time you access a page from your
browser, the server that contains the page (or that you think
contains the page) looks for the page and sends a numeric code
back to your browser. If everything goes alright, the server
sends the code 200 back to you and the page is displayed. If the
page isn't found, the server sends a 404 code back. That's why
page-not-found errors are commonly called 404 errors.
There are lots of different HTTP codes, but you'll only need to
make pages for a few of them:



400: Bad request. The server can't understand the request
you're sending. This is rarely seen (hopefully).



401: Authorization required. In order to access this page,
you'll need a username and password.



403: Forbidden. The server was instructed to refuse your
request.



404: Page not found. Our friend the 404 error. You'll use this
page the most often.



408: Timeout. The request could not be completed in the time
allowed for it. Your browser will usually automatically generate
a message when this occurrs.



500: Internal ser

Have a Question and dont know the answer post it below and get answers in minutes

Due to spam this feature is disabled
To get answers fast , make sure you enter a detailed subject for example: "DataGrid issues need answer" not "DataGrid"

Subject:

Catjegory Name:

Message:



© 2008 dotnetwatch.com -- Privacy policy

Website Design & Internet Marketing by Shivam