How to redirect to user error page using mod_rewrite based on 404 error

I am trying to use mod_rewrite to be able to redirect my custom html error page when 404 is returned. Right now my HTTP server is working and my application server (Websphere) is working. When I remove the service on the application server, it returns a message as follows:

SRVE0255E: web group / virtual host to handle localhost: 80 is not defined.

I want to be able to redirect to my custom error message based on the response, rather than showing this error message. Trying to use the ErrorDocument directive in the httpd.conf file does not work, but I heard that it is possible to do this with mod_rewrite. I am not sure how to do this.

+3
source share
2 answers

Have you tried something like this:

ErrorDocument 404 /not-found.asp
0
source

We can publish messages like "Server under maintenance, thanks for your patience!", Adding a custom property. We cannot redirect it to a custom static page.

0
source

Source: https://habr.com/ru/post/1712474/


All Articles