rubysecurity.org

Anecdotes from a Linux Systems Administrator. /root

Home About Books Blog Portfolio Archive
5 May 2012

301 URL redirect on Ruby on Rails

by Alpha01

In your respective controller, specify the method of the view in questioned that needs to be redirected.

def code
   headers["Status"] = "301 Moved Permanently"
   redirect_to "https://www.example.com/alpha01"
 end
Tags: [ ruby ]