One of the challenges of ExpressionEngine is that, because we are not dealing with physical files, it is not always clear to ExpressionEngine if a page being requested is a valid page or not. Try visiting http://localhost/ihatetoast
or http://www.example.com/ihatetoast
; ExpressionEngine does not recognize ihatetoast
, and so returns the index page of the default template group. This is terrible for search engines as it can make our website look like it has thousands of pages all with the same content. To combat this, we can define our own 404 page.
Note
In some situations, defining a 404 page can cause existing URLs on your ExpressionEngine site to stop working. If you have URLs on your site that do not include the template group name and do not use the Pages module, those pages will be returned 404. To work around this, either use the Pages module to maintain your existing URL structure or do not turn on the 404 functionality.
1. First, we need to create a template...