Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

handler301

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handler301

  • 0.2.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= Handler 301

Handler 301 is a plugin for Ruby on Rails that lets you easily manage 301 redirections in on place in order to redirect them to current named routes.

All necessary informations are available on the wiki : http://wiki.github.com/kwi/handler301

== Configuration example :

In the config/handler301.yml of your rails app :

"old_url.html": home_path "old_url_without_path.html": home "product_number_one.html": products_path :id => 1

Then, configure a controller that match non matching routes in your config/routes.rb

==== Rails2

ActionController::Routing::Routes.draw do |map| map.connect "*path", :controller => 'error', :action => 'handle404' end

==== Rails3

MkdBaseApp::Application.routes.draw do match "*path" => 'error#handle404' end

And finally, in your ErrorController (or whatever the name of your non matching routes controller) :

class ErrorController < ApplicationController def handle404 unless handle_301(request.path, request.query_parameters)

    # Do your stuff here

  end
end

end

== TODO

  • Change for using Rails metal in order to speed up the mechanism

Copyright (c) 2010 Guillaume Luccisano - g-mai|: guillaume.luccisano, released under the MIT license

FAQs

Package last updated on 03 Jun 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc