If someone mistypes a “product” URL on my site, I’d like to show some links to other products. And, similarly, if they mistype a “service” URL, I’d like to show them some other links to our services. But each 404 page would have distinctly different links on it. How can I add more than just one string of content to the 404 page? e.g. if someone types:
http://example.com/products/ipud/
I’d like to show a 404 page with “you might be looking for ipad, ipod, …” and the list could be fairly long. In my controller I currently have:
throw new CHttpException(404,"Product not found.");
Instead, can I have custom 404 views, like "views/site/404-product.php" and "views/site/404-service.php"? Alternatively can I just send the 404 header separately then call my own ->render() function?