当我使用ErrorDocument时,404 Not Found错误

我知道这个线程已经在networking上和这里讨论了很多,我尝试了几乎所有的方法,但是我仍然遇到同样的问题。

我的conf文件:

<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 

在文件夹/var/www/html我有这样的:

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

自定义错误页面不起作用。 所以我该怎么做 ?

您的custom_404.html位于错误的目录中。 它需要在/var/www/html的configuration。 你也可以把它留在原来的位置,但是它是
ErrorDocument 404 /myApp/static-1.0.0-20170512094719/custom_404.html

试试下面,

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

我们提供完整的path与错误文件的域名。