• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Proper 404 for non-existing element

Hi there!

I have a website that shows interesting places in my city. Places are available under URLs:

mydomain.com/place-3333 (where 3333 is place's id).

However, if you manually type in your browser some fake ID like:


then application returns code 200 and shows a view without any data in there. This is not good in terms of SEO.

My model returns false if there is no such place in the database. In the controller, I have problem with proper redirecting and sending 404 error.

Could please sombody help me with it?


If you want to throw a 404 error, just use the show_404() function.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.