When someone goes to my site with wrong route, rails responses with 404 code and the error
ActionController::RoutingError No route matches
Can I response with 410 code on the rails’s error instead of 404?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I am not sure why you would want to as a 410 error (Gone) is for a resource that was once available but isn’t anymore.
If you follow the answer at https://stackoverflow.com/a/5360684/219743 then it allows you to do it.
Just change the render_404 method to
If you still want to point to 404.html in the public folder: