/    Sign up×
Community /Pin to ProfileBookmark

How to make a custom "404 error" page!

when users enter a page in my website which doesn’t exist, I don’t want the browser to display standard 404 error page. As far as I know I can create a sample page for my users to explain some possible reasons why they got to that page. Does anyone know how it is done?
Thanks

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiJan 12.2010 — You will need to set the Apache ErrorDocument directive. If you have access to httpd.conf you can add it there (or in the relevant virtualhost block for your site), otherwise you can add the following to an .htaccess file in your document root:

ErrorDocument 404 /404.html

Obviously /404.html should point to your 404 page. You can also change the response code to create other error pages if you want to.
×

Success!

Help @harevik85 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.11,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...