Mobile app version of vmapp.org
Login or Join
Shelley277

: I can't personalise my error pages -- Apache ErrorDocument directive results in additional not found error I use apache 2.4.10, and I can't use personal error pages. I changed /etc/apache2/conf-available/localized-error-pages.c

@Shelley277

Posted in: #Apache2 #Error

I use apache 2.4.10, and I can't use personal error pages.

I changed /etc/apache2/conf-available/localized-error-pages.conf and added :

ErrorDocument 404 /404.html


and created the file /var/www/404.html with the short string 404test inside.

However, when I relaunch apache, I get


Not Found

The requested URL / was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to
use an ErrorDocument to handle the request.


What's wrong?
Is there a way to get more detail on the error?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelley277

3 Comments

Sorted by latest first Latest Oldest Best

 

@Lengel546

Do not use .htaccess it add extra useless disk access.

Edit your web site configuration in /etc/apache2/sites-enabled/{yoursite}.conf add this outside any tag

# Error documents
ErrorDocument 404 /404.htm

# allow errors pages to be visible from any virtual host
Alias /404.htm /var/www/errors/404.htm


Like that your error pages will be available for any of your virtual host, without adding extra code in virtual host and save harddrive useless access.

10% popularity Vote Up Vote Down


 

@Sherry384

Using internet explorer?
your 404 page should have a minimum 0f 512 bytes of text. So say a line or 10.
just try it with longer text.

10% popularity Vote Up Vote Down


 

@Correia994

Roll back your changes in /etc/apache2/conf-available/localized-error-pages.conf, then use .htaccess to create a custom 404 page with the following:

ErrorDocument 404 /404.html


If that fails then try adding the full path to the 404.html document.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme