: Custom message error with apache2 I am currently running a web server using Apache 2.4.10. I would like to know how I can make custom error page, using the proper way. Please, note that several
I am currently running a web server using Apache 2.4.10.
I would like to know how I can make custom error page, using the proper way.
Please, note that several solutions are available online, but seem deprecated.
I noticed the configuration file /etc/apache2/conf.d/localized-error-pages.conf. It informs me that the default messages were available in the directory /usr/share/apache2/error/.
It also tells me that in order to change the layout, I should add the line :
Alias /error/include/ "/your/include/path"
But it doesn't explain where/how.
Moreover, I tried to change these files, reload apache2, and get an error page, but the error messages didn't change
More posts by @Caterina187
1 Comments
Sorted by latest first Latest Oldest Best
The proper way to make custom error messages is by using .htaccess.
First off, make an .htaccess file in your site directory. The syntax is easy:
ErrorDocument code path
So for example, if you were to build a custom error page for the 404 message, you could use this line of code given the path for your 404 document is 404.html.
ErrorDocument 404 404.html
Same way for errors like 500:
ErrorDocument 500 500.html
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.