I am currently in the process of creating a custom 500 page for a wordpress website. I manually break the site using this in the header:
<?php header('location : '); ?>
in the .htaccess I have this:
ErrorDocument 500 /wp-content/500.php
I had it as /wp-content/500.html in the htaccess and that worked beautifully. But I actually want it as .php, but for some reason it gives me this error: "This site can't be reached. The connection was reset" on chrome and a similar error on a different browser.
Why doesn't a .php site not work for a 500 error page? Is it because of the way I broke it?
Thank you in advance.
If your page /wp-content/500.php
also generate an error (so it goes to the ErrorDocument 500, then again, …), it may do an infinite loop.
You can check the apache/php errors logs which may gives you additionnal clue.
You can also activate the Wordpress Debug mode by adding the following code in your wp-config.php
:
define('WP_DEBUG', true);
You can try to add at the top of your 500.php page (after <?php
) something like die("This works so far at line ".__LINE__);
.