Can i use redirects to catch all 400, 403, 404 and 500 pages to one 404 page?

Hi there,
I just want one 404 page which will catch anyone mistyping the domain name in or trying to get to a page which isn’t live. So I’ve created an oops page here: https://www.wesmcghee.com/404.php.

Can I simply pop this in my htaccess file or is it bad practice to do this?
ErrorDocument 400 https://www.wesmcghee.com/404.php
ErrorDocument 403 https://www.wesmcghee.com/404.php
ErrorDocument 404 https://www.wesmcghee.com/404.php
ErrorDocument 500 https://www.wesmcghee.com/404.php

Did you ever encountered these other errors (than 404 not found)?

No not that I know of, I was just trying to cover all the possible error options. Is it unnecessary?

There’s a lot more than you have listed. Typing errors should get you a 404. Each error number has a reason, and really should be displayed to help the user determine what went wrong.

1 Like

If you aren’t using special server side features beside PHP on Apache, you should be fine with 404.

1 Like

Your host should be able to give you some code to take care of everything. Fire them a support ticket.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.