• Hi,

    When activating the “maintenance mode” and then visiting a page i.e. https://example.com/testpage it returns a http 500 response and shows the maintenance page. On the frontpage it shows a 200.

    I believe this is wrong as the correct http status code should be 503 according to RFC7231: https://tools.ietf.org/html/rfc7231#section-6.6.4

    Though, I know many other maintenance plugins lets users specify if the either want a 503 or just a 200 (Repsonse OK).

    Hope this will help make the plugin even better.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Thanks for your feedback, but I am not sure technically how to implement this. If you know how you are welcome to contribute to the plugin. Thanks,

    Thread Starter Wp-user865966

    (@vitago)

    If you’re not sending the http 500, then theres an php error in the plugin somewhere. ??

    I’m not sure neither. I’ll have a look at the code and see if I can get any further.

    Thread Starter Wp-user865966

    (@vitago)

    Hi @northernbeacheswebsites

    I’ve looked through the code and you just need to replace line 811 with this:

    header( $_SERVER[“SERVER_PROTOCOL”] . ‘ 503 Service Temporarily Unavailable’, true, 503 );

    Then we’re good to go again ??
    It both works on the frontpage and subpages.

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    mmmm there does look to be an issue, but the code you suggested doesn’t solve the issue (at least for me). When maintenance mode is active it should display the coming soon content. When I use your code or my original code it displays an error page “502 Bad Gateway”. The solution from my end is removing this header line altogether and that solves the issue for me and displays the coming soon content. Does this work for you?

    What server are you using nginx? apache? are you on a live or local server?

    Thanks,

    Thread Starter Wp-user865966

    (@vitago)

    If I remove the line it works fine and returns a http 200.

    I’m on a live environment, using both apache and nginx (Reverse proxy). I’m using http2.

    What about this line instead:
    header(‘HTTP/1.1 503 Service Temporarily Unavailable’, true, 503 );

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    That works fine – it’s really not all that different to what I started with though. But this will be in the next release – not sure when that will be. Thanks for your contribution.

    Thread Starter Wp-user865966

    (@vitago)

    Agrred – It’s really close. The reason for “$_SERVER[“SERVER_PROTOCOL”] ” is because my webserver uses http2. But I tested before and it is able to upgrade itself so 1.1 should be fine.

    And then it’s really just a matter of the text. I don’t know why it’s so hysterical about what’s written as the first parameter, but it has to be pretty specific.

    But sound great, and looking forward to it!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘http error 500 on pages when on maintenance’ is closed to new replies.