# Redirect loop

**URL:** <https://www.ruby-forum.com/t/redirect-loop/193106>\
**Category:** Rails\
**Created:** [August 11, 2010, 12:03pm UTC](https://www.ruby-forum.com/t/redirect-loop/193106 "2010-08-11T12:03:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [August 11, 2010, 12:03pm UTC](https://www.ruby-forum.com/t/redirect-loop/193106/1 "2010-08-11T12:03:52Z")

</div>

I have one record in a database that is encountering a redirect loop.

When I point my browser to “[www.sitenamehere.co.uk/case\_studies/1](http://www.sitenamehere.co.uk/case_studies/1)”, it  
displays a redirect loop error message.

When I point my browser to “[www.sitenamehere.co.uk/case\_studies/2](http://www.sitenamehere.co.uk/case_studies/2)”, it  
does not.

Now, when I point my browser to  
“[www.sitenamehere.co.uk/case\_studies/show/1](http://www.sitenamehere.co.uk/case_studies/show/1)”, no error occurs and the  
page is displayed exactly as it should.

Also, when I point my browser to  
“[www.sitenamehere.co.uk/case\_studies/show/2](http://www.sitenamehere.co.uk/case_studies/show/2)”, no error occurs and the  
page is displayed exactly as it should.

What is the problem here? My routes are set up correctly when I review  
the output of rake routes.

If there’s any code you need, please ask. However, I assume someone has  
encountered this before.

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [August 11, 2010, 4:01pm UTC](https://www.ruby-forum.com/t/redirect-loop/193106/2 "2010-08-11T16:01:00Z")

</div>

On Wed, Aug 11, 2010 at 06:03, Pale H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have one record in a database that is encountering a redirect loop.

So what’s different about that record? I’d bet it includes or  
references some resource that’s the problem.

-Dave

–  
Specialization is for insects. -RAH | Have Pun, Will Babble! -me  
Programming Blog: [http://codosaur.us](http://codosaur.us) | Work: [http://davearonson.com](http://davearonson.com)  
Leadership Blog: [http://dare2xl.com](http://dare2xl.com) | Play: [http://davearonson.net](http://davearonson.net)

- 
  - 
    - 
      - 
        - WATCH THIS SPACE \* \* \* \* \* | Ruby: [http://mars.groupsite.com](http://mars.groupsite.com)

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [August 11, 2010, 4:02pm UTC](https://www.ruby-forum.com/t/redirect-loop/193106/3 "2010-08-11T16:02:20Z")

</div>

Dave A. wrote:

> On Wed, Aug 11, 2010 at 06:03, Pale H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I have one record in a database that is encountering a redirect loop.
> 
> So what’s different about that record? I’d bet it includes or  
> references some resource that’s the problem.
> 
> -Dave
> 
> –  
> Specialization is for insects. -RAH ï¿½| Have Pun, Will Babble! -me  
> Programming Blog: [http://codosaur.us](http://codosaur.us) | Work: [http://davearonson.com](http://davearonson.com)  
> Leadership Blog: ï¿½[http://dare2xl.com](http://dare2xl.com) | Play: [http://davearonson.net](http://davearonson.net)
> 
> - 
> - 
> - 
> - 
> - WATCH THIS SPACE \* \* \* \* \* | Ruby: [http://mars.groupsite.com](http://mars.groupsite.com)

Surely if that were true, it’d error when I pass in the ‘show’ action  
into the URL?

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [August 11, 2010, 4:23pm UTC](https://www.ruby-forum.com/t/redirect-loop/193106/4 "2010-08-11T16:23:51Z")

</div>

On Aug 11, 6:03 am, Pale H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What is the problem here? My routes are set up correctly when I review  
> the output of rake routes.

Look at your log files to see where the browser is being redirected &  
by what bit of your code

Fred

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [August 11, 2010, 4:11pm UTC](https://www.ruby-forum.com/t/redirect-loop/193106/5 "2010-08-11T16:11:31Z")

</div>

Pale H. wrote:

> Dave A. wrote:
> 
> > On Wed, Aug 11, 2010 at 06:03, Pale H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > I have one record in a database that is encountering a redirect loop.
> > 
> > So what’s different about that record? I’d bet it includes or  
> > references some resource that’s the problem.
> > 
> > -Dave
> > 
> > –  
> > […]
> 
> Surely if that were true, it’d error when I pass in the ‘show’ action  
> into the URL?

That depends on how your routes are set up.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
