Create a custom 404 (page does not exist) page for apache2 Ubuntu: ==================================================================== 1. On the root of your web server's storage directory (default: /var/www/html), create a .htaccess file and add these contents: # Error Documents ErrorDocument 404 /Spec/error/404.php 2. Create the error.html file (in my case 404.php with wanted path from the root of my server) and add the contents you want like a normal php or html file. 3. edit the /etc/apache2/apache2.conf file and make these changes: A) remove comment sign if you find it before this line (near end of file): AccessFileName .htaccess B)Edit the "" sub section and change "AllowOverride None" to "AllowOverride All" May need to do this step for each website mirror you have. C) After saveing changes to that file, run command "sudo a2enmod rewrite" then "sudo /etc/init.d/apache2 restart". 4. You now have your own custom error page! --------------------------------------------------------------------------------------------------------------------------- Sources: https://www.digitalocean.com/community/tutorials/how-to-create-a-custom-404-page-in-apache https://tecadmin.net/create-a-custom-404-error-page-on-apache/ https://webmasters.stackexchange.com/questions/61009/how-to-enable-use-of-htaccess-in-apache-on-ubuntu Date: December 27th 2023