Receiving Wordpress a server error

I try to connect a server error to WP. Is it possible to force WP and receive server error using PHP?

Please rephrase your question, it is not making much sense.

Any server errors that a server gets is usually recorded in a log file on the server if you are wanting to determine what type of error occurred. Look for a php error log.

But again, if this is not an answer to your question, please re-ask your question and provide more information on what you are trying to do. Thanks! :slight_smile:

Where are you storing the WP to?
Attempts to activate the debug

Is the error in all urls?

As we know we have an error page 404 which is connected to WP site. If you have 402, I try to detect number and show 402 site. Images are related to specific numbers 404, 40X…

You can set custom error pages using .htaccess. I’m not quite sure if this is what you’re looking for.

There are some functions by default https://developer.wordpress.org/reference/classes/wp_error/ but we talk abour server side errors.

There are many error plugins:

  1. https://wordpress.org/plugins/error-log-monitor/, Error Log Monitor
  2. 404page – your smart custom 404 error page, https://wordpress.org/plugins/404page/

I try to do without plugin inside functions.php. As I understand a correct code 404 is delivered which tells search engines that the page does not exist and has to be removed from the index.

I try to do the following:

  1. add a line to your .htaccess file:
    ErrorDocument 402 /errors/402.php
  2. I do not like add any additional server requests.

More importantly, it tells human visitors the page doesn’t exist. :wink:

1 Like

Well it won’t tell them much if you send them Payment Required messages instead of Document Not Found messages…

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