Object not found - Error 404 in htaccess

Asked

Viewed 451 times

1

On a site I develop, when writing a link that does not exist, gives me error according to the following image.

Objeto não encontrado - Error 404

I intend that, when writing a link that doesn’t really exist, show an error 404 page without changing the link instead of showing this warning message of "Object not found".

If it is possible to create this in htaccess, for me it would be one of the possibilities.

1 answer

2

To create the redirect, you must use the Errordocument directive, add in your .htaccess, as you can see in the example:

## Redirecionar em caso de erros ##
ErrorDocument 404 /404.php
  • Commented with Errordocument 400, but it’s error 404. I edited, and tested and yes, this is the solution.

  • you can include more of these lines, for other error like 500, 502, etc

Browser other questions tagged

You are not signed in. Login or sign up in order to post.