Question

When someone is browsing a page on the internet let say

www.example.com/browse.php, if there is no internet access or that the page does not exist, it will display error eg ** Server not found

Firefox can't find the server at www.example.com/browse.php.

Check the address for typing errors such as ww.example.com instead of www.example.com
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.**

my question is how can i redirect those error to particular page eg error.php using .htaccess file

Thank You

Pas de solution correcte

Autres conseils

You can't - the browser handles connection errors, not the server.

Besides - how in the world would your server find the custom error page, if it can't connect to the server in the first place?

you can define custom error page handle in apache .htaccess file:

ErrorDocument 400 /errors/badrequest.html
ErrorDocument 401 /errors/authreqd.html
ErrorDocument 403 /errors/forbid.html
ErrorDocument 404 /errors/notfound.html
ErrorDocument 500 /errors/serverr.html
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top