If you have LAMP installed and your website is in /var/www or public_html folder check if you already have .htaccess file by typing command
ls -a to see hidden files. If the htaccess file is not there create it by typing
nano .htaccess
insert
ErrorDocument 404 http://www.domain.com/404page.html
where you can also use local path /404page.html and also rename the 404page if you want.
Then give access to your htaccess file with chmod 644 .htaccess
Thats it. Now navigate to yourdomain.com/thispagedoesntexist.html and see your 404 error page.
Explained here more specifically: http://www.htmlgoodies.com/beyond/reference/article.php/3472591
Ei kommentteja:
Lähetä kommentti