A Web Design Community curated by Chris Coyier

A little dab'll do ya

Code Snippets

Code Snippets > HTAccess > Custom Error Pages Submit one!

Custom Error Pages

ErrorDocument 400 /errors/badrequest.html
ErrorDocument 401 /errors/authreqd.html
ErrorDocument 403 /errors/forbid.html
ErrorDocument 404 /errors/notfound.html
ErrorDocument 500 /errors/serverr.html

Subscribe to The Thread

  1. Will says:

    do the error pages have to be html?

  2. Vineet says:

    Hey, I used this snippet for .htaccess and also made the error pages but for some reason, its not working. I can’t see my custom error pages even though I’ve checked all file paths and everything.
    where did I go wrong?
    my htaccess file looks like this:

    ErrorDocument 400 /errors/badrequest.html
    ErrorDocument 401 /errors/authreqd.html
    ErrorDocument 403 /errors/forbid.html
    ErrorDocument 404 /errors/notfound.html
    ErrorDocument 500 /errors/serverr.html
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?qumatech\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpg|gif|bmp|png)$ /images/dontsteal.gif [L]

    please help, I am new with htaccessing :/
    thank you!

It's Your Turn

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
--- The Management ---