diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 6cc019c6..afb60535 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -235,7 +235,7 @@ class WikiController < ApplicationController real_page = WikiReference.page_that_redirects_for(@web, @page_name) if real_page flash[:info] = "Redirected from \"#{@page_name}\"." - redirect_to :web => @web_name, :action => 'published', :id => real_page + redirect_to :web => @web_name, :action => 'published', :id => real_page, :status => 301 else render(:text => "Page '#{@page_name}' not found", :status => 404, :layout => 'error') end @@ -324,8 +324,10 @@ class WikiController < ApplicationController real_page = WikiReference.page_that_redirects_for(@web, @page_name) if real_page flash[:info] = "Redirected from \"#{@page_name}\"." - redirect_to :web => @web_name, :action => 'show', :id => real_page + redirect_to :web => @web_name, :action => 'show', :id => real_page, :status => 301 else + flash[:info] = "Page \"#{@page_name}\" does not exist.\n" + + "Please create it now, or hit the \"back\" button in your browser." redirect_to :web => @web_name, :action => 'new', :id => @page_name end else diff --git a/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb b/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb index 829e7d6b..22ae14b3 100644 --- a/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb +++ b/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb @@ -9,6 +9,7 @@ module Rack server = ::WEBrick::HTTPServer.new(options) server.mount "/", Rack::Handler::WEBrick, app trap(:INT) { server.shutdown } + trap(:TERM) { server.shutdown } yield server if block_given? server.start end