When a visitor to your site requests a page that does not exist or no longer exists, he is shown a generic error message which is not very intuitive of friendly (something like 'HTTP 404 Not Found').
It is considered a good practice to display your own custom 404 page to the visitor when the page he is looking for cannot be found.
In Couch, there are two kinds of pages that cannot be found -
For the first scenario mentioned above, the .htaccess file needs to be used while Couch can take care of the second scenario with a little help from you.
Setting up your custom 404 page requires two steps -
#If you wish to use a custom 404 page, place a file named 404.php in your website's root and uncomment the line below. #If your website is installed in a subfolder, change the line below to reflect the path to the subfolder. #e.g. for http://www.example.com/subdomain1/subdomain2/ make it ErrorDocument 404 /subdomain1/subdomain2/404.php #ErrorDocument 404 /404.php
The 404.php file you create above will now be used for all the kinds of non-existent files that are requested.
Customize it to suit your needs. Make sure all links and image sources within it are defined absolutely. You can prefix <cms:show k_site_link /> to all the paths to make them absolute e.g.
<img src="<cms:show k_site_link />images/logo.jpg" />
TIP: Internet Explorer (IE) has a frustrating 'feature' where it will ignore any custom 404 file that happens to be less than 512 bytes in size.
Make sure your 404.php template is larger than 512 bytes (though this might require padding it with unneccessary fluff).