module SiteControllerEx def self.included(base) base.class_eval do alias_method :show_page_without_filters, :show_page alias_method :show_page, :show_page_with_filters end end def show_page_with_filters url = params[:url].to_s @page = find_page(url) unless @page.nil? pre_process_results = @page.before_process(request, response) return unless pre_process_results if live? and (@cache.response_cached?(url)) @cache.update_response(url, response) @performed_render = true else @page.process_without_filters(request, response) @cache.cache_response(url, response) if live? and @page.cache? @performed_render = true end @page.after_process(request, response) else render :template => 'site/not_found', :status => 404 end rescue Page::MissingRootPageError redirect_to(:controller => 'admin/welcome') end end