# Redirect\_to issue - lost port number

**URL:** <https://www.ruby-forum.com/t/redirect-to-issue-lost-port-number/167026>\
**Category:** Rails\
**Created:** [May 2, 2009, 12:35pm UTC](https://www.ruby-forum.com/t/redirect-to-issue-lost-port-number/167026 "2009-05-02T12:35:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeDucharme](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@MikeDucharme](https://www.ruby-forum.com/u/MikeDucharme)\
**Post date:** [May 2, 2009, 12:35pm UTC](https://www.ruby-forum.com/t/redirect-to-issue-lost-port-number/167026/1 "2009-05-02T12:35:45Z")

</div>

Hi all,

I found an issue with “redirect\_to” by accident and hoped someone  
could fill me in on what is happening. If I try to do a redirect to  
somewhere that doesn’t exist, the port number will be dropped from the  
url and I get a “Can’t connect to server” error.

[http://localhost:3000/some-folder/](http://localhost:3000/some-folder/)

redirect\_to “beans”

[http://localhost/](http://localhost/)

I guess it’s defaulting to port 80, but can anyone tell me why?
