404 Not Found error while when i use ErrorDocument

Posted on

404 Not Found error while when i use ErrorDocument – Problems with loading a website are often blamed on the Internet connection, but even the most perfectly set up network cannot help if there is no service to reply at your destination. One of the most popular HTTP servers used for this task is Apache2. Much of Apache’s popularity can be attributed to its easy installation and use, but never the less it is possible to run into problems with even the easiest of the software. If you’ve encountered an issue loading your web page, follow these simple troubleshooting methods outlined in this guide to attempt to get your web server back up and working again. Below are some tips in manage your apache2 server when you find problem about apache-2.2, apache2, , , .

I know this thread has been talked a lot on the web and here, and I tried almost all the methods, but still I’m having the same problem.

My conf file:

<Proxy balancer://balancer-applitutoriel>
        BalancerMember http://localhost:8888 route=js1 retry=30 keepalive=on ttl=10 loadfactor=3 flushpackets=auto timeout=300

        Require all granted
</Proxy>

AliasMatch ^/myApp/static-([^/]+)/(.*)$ /var/www/html/myApp/static-$1/$2
ProxyPassMatch ^/myApp/static !
ProxyPass /myApp balancer://balancer-applitutoriel/myApp stickysession=NODESESSIONID nofailover=on

ProxyErrorOverride On
ErrorDocument 404 /custom_404.html

In folder /var/www/html i have this:

myApp
│   └── static-1.0.0-20170512094719
│       ├── config-spa.json
│       ├── css
│       │   ├── auth.css
│       │   └── theme.css
│       ├── custom_404.html
└── index.html

The custom error page is not working. So what should I do ?

Your custom_404.html is in the wrong directory. It needs to be in /var/www/html for that configuration.
You can also leave it where it is, but then it is
ErrorDocument 404 /myApp/static-1.0.0-20170512094719/custom_404.html

Try with below,

ErrorDocument 404 http://yourdomain.com/myApp/static-1.0.0-20170512094719/custom_404.html

We are providing full path with domain name to error file.

Leave a Reply

Your email address will not be published.