# Remove 12002 from http://www.projectbidding.com:12002/account/index

**URL:** <https://www.ruby-forum.com/t/remove-12002-from-http-www-projectbidding-com-12002-account-index/172184>\
**Category:** Rails\
**Created:** [July 16, 2009, 1:59pm UTC](https://www.ruby-forum.com/t/remove-12002-from-http-www-projectbidding-com-12002-account-index/172184 "2009-07-16T13:59:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seenu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecae2f/32.png) [@seenu](https://www.ruby-forum.com/u/seenu)\
**Post date:** [July 16, 2009, 1:59pm UTC](https://www.ruby-forum.com/t/remove-12002-from-http-www-projectbidding-com-12002-account-index/172184/1 "2009-07-16T13:59:11Z")

</div>

Hi,

How can i remove 12002 from the URL  
[http://www.projectbidding.com:12002/account/index](http://www.projectbidding.com:12002/account/index)  
i am using ruby on rails. I just need to have my url  
[http://www.projectbidding.com/account/index](http://www.projectbidding.com/account/index).

Please help me on this

---

<div class="post-metadata">

**Author:** ![seenu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecae2f/32.png) [@seenu](https://www.ruby-forum.com/u/seenu)\
**Post date:** [July 16, 2009, 2:23pm UTC](https://www.ruby-forum.com/t/remove-12002-from-http-www-projectbidding-com-12002-account-index/172184/2 "2009-07-16T14:23:09Z")

</div>

On Jul 16, 2009, at 7:58 AM, seenu wrote:

> Hi,
> 
> How can i remove 12002 from the URL [http://www.projectbidding.com:12002/account/index](http://www.projectbidding.com:12002/account/index)  
> i am using ruby on rails. I just need to have my url  
> [http://www.projectbidding.com/account/index](http://www.projectbidding.com/account/index).
> 
> Please help me on this

Well, I suppose the snarky answer is run your listener on port 80 (the  
default for the http protocol), but since that may not be helpful, let  
me guess what you really need.

You’re in a controller and want to construct that URI from the request:

“#{request.protocol}#{request.host}#{request.request\_uri}”

If you replaced request.host with request.host\_with\_port you’d get the  
equivalent of request.url

[http://www.railsbrain.com/api/rails-2.3.2/doc/index.html?a=M000469&name=protocol](http://www.railsbrain.com/api/rails-2.3.2/doc/index.html?a=M000469&name=protocol)

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![seenu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecae2f/32.png) [@seenu](https://www.ruby-forum.com/u/seenu)\
**Post date:** [July 16, 2009, 3:04pm UTC](https://www.ruby-forum.com/t/remove-12002-from-http-www-projectbidding-com-12002-account-index/172184/3 "2009-07-16T15:04:04Z")

</div>

actually i need to type the whole thing [projectbidding.com:12002](http://projectbidding.com:12002) for  
the server to come up is there any way where i can get the server up  
just by typing [projectbidding.com](http://projectbidding.com) and on more question what exactly  
this 12002 mean, is it a port on which my rails application running?

On Jul 16, 5:22 pm, Rob B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![seenu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecae2f/32.png) [@seenu](https://www.ruby-forum.com/u/seenu)\
**Post date:** [July 16, 2009, 4:45pm UTC](https://www.ruby-forum.com/t/remove-12002-from-http-www-projectbidding-com-12002-account-index/172184/4 "2009-07-16T16:45:18Z")

</div>

Yes, that is the port. You’d need to specify that mongrel or thin or  
whatever listens on port 80 or, if Apache is listening on port 80,  
proxies the requests through to that port (or, more likely, using a  
proxy balancer to hit a small number of instances of your rails  
application on consecutive ports).

-Rob
