Error 500 on server- Invalid URL

1

Whenever I have access to a URL that does not exist on my site, this error appears

  

The server encountered an internal error or misconfiguration and was   unable to complete your request.

Is there any way to customize this error message or show a default page?

The site is in Wordpress and does not have .htaccess, however I can change the Apache settings directly.

I inserted the line

 ErrorDocument 500 /error/erro500.html

and one more error appeared:

  Additionally, to 500 Internal Server Error error was encountered   while trying to use an ErrorDocument to handle the request.

    
asked by anonymous 05.11.2015 / 14:46

2 answers

1

You can personalize the errors, yes.

ErrorDocument 500 "Sorry, our script crashed. Oh dear"
ErrorDocument 500 /cgi-bin/crash-recover
ErrorDocument 500 http://error.example.com/server_error.html
ErrorDocument 404 /errors/not_found.html 
ErrorDocument 401 /subscription/how_to_subscribe.html

Reference: link

Or if you are using nginx server:

error_page 404 /404.html;

In the example of these commands every time the error is triggered, it will call the predefined message or page. Be careful not to cause a loop.

    
05.11.2015 / 15:14
1

If you are using Apache as a WEB server, add this line to the .htaccess file:

ErrorDocument 500 http://yourwebsite.com/error-500

This .htaccess file should be in the root of the public directory of the site.

The strange point in your question is that error 500 should indicate an internal error on the server.

The correct code for nonexistent page is the 400 code.

Maybe something misconfigured on the server or may even be some command sent by scripts like PHP.

    
05.11.2015 / 15:07