# Redirect\_to response code?

**URL:** <https://www.ruby-forum.com/t/redirect-to-response-code/53360>\
**Category:** Rails\
**Created:** [February 2, 2006, 10:29am UTC](https://www.ruby-forum.com/t/redirect-to-response-code/53360 "2006-02-02T10:29:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Onur\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@Onur\_T](https://www.ruby-forum.com/u/Onur_T)\
**Post date:** [February 2, 2006, 10:29am UTC](https://www.ruby-forum.com/t/redirect-to-response-code/53360/1 "2006-02-02T10:29:15Z")

</div>

hi,  
I wanted to make some redirects from my old page urls to my new ones.  
In order to make google see the pages have moved permanently, I have  
to send a 301 moved permanently code to google. when I use redirect\_to  
it sends a 302 moved temp. code. Can I change this behaviour?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Onur\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@Onur\_T](https://www.ruby-forum.com/u/Onur_T)\
**Post date:** [February 2, 2006, 6:43pm UTC](https://www.ruby-forum.com/t/redirect-to-response-code/53360/2 "2006-02-02T18:43:48Z")

</div>

Before you do redirect\_to set ‘Status’ header like so

@headers[“Status”] = “301 Moved Permanently”

Kent.
