Testing htaccess for 500 server error without actual error

.htaccess500-errorapache-2.2

After reading some tutorials, I have created an error file, that should be displayed instead of 500 server error. I have added it to domain's root and added the following line to the bottom of .htaccess:

ErrorDocument 500 /error.html

Now the question is, how can I test it on a live site and make sure that the error page appears, when site really crashes?

Any suggestions are much appreciated.

Best Answer

I created a folder called http500 in the www root

I put a .htaccess file into that folder with the following:

Redirect 500 /http500

I then opened it http://example.com/http500

You can try out different error pages

Redirect 501 /http500

or

Redirect 502 /http500

or

Redirect 503 /http500

It did not require any server restart, the change applied immediately.

Sources:
https://stackoverflow.com/a/8687536/534883
https://bibwild.wordpress.com/2013/06/05/how-to-make-apache-fake-a-500-http-response/