From: "Pierre d." Date: 2012-10-25T20:06:22+09:00 Subject: Re: Googlebot- How to generate a 404 error status after a if statement Hassan Schroeder wrote in post #1081027: > On Wed, Oct 24, 2012 at 3:07 PM, Pierre d. wrote: > >> How could I generate a 404 error status whenever I want and if possible >> in a rhtml file? > > In the relevant controller method add: > > response.status= 404 > > Done. Ok this is my controller: class StoreController < ApplicationController include ERB::Util layout "store" def index begin page = StaticPage.find_by_id!(53) @text = page.text params[:locale] rescue ActiveRecord::RecordNotFound flash[:notice] = t :page_not_found redirect_to index_url end @total, @products = build_list Histoire.scoped(:order=>"id DESC"), {:field=>params[:field],:query=> params[:query]},nil,5 @cart = find_cart @page_title = t(:stories) end I will add "response.status=404" in it. But what should I write in the index.rhml in my if statement, instead of my "meta http-equiv="refresh"?: <% if params[:locale] == "en" || params[:locale] == "de" || params[:locale] == "fr" %> -display the html code of the page - <%else%> <%end%> thank you for your help -- Posted via http://www.ruby-forum.com/.