# Links always go to 'localhost'

**URL:** <https://www.ruby-forum.com/t/links-always-go-to-localhost/119479>\
**Category:** Deployment\
**Created:** [November 7, 2007, 10:35am UTC](https://www.ruby-forum.com/t/links-always-go-to-localhost/119479 "2007-11-07T10:35:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [November 7, 2007, 10:35am UTC](https://www.ruby-forum.com/t/links-always-go-to-localhost/119479/1 "2007-11-07T10:35:47Z")

</div>

I have installed Apache2.2 + Mongrel and deployed my build on.  
Now I am accessing it over LAN. When I enter [http://mymachinename/myapp](http://mymachinename/myapp)  
it opens fine but when I click on any link in my rails app, it replaces  
mymachinename with localhost ([http://localhost/myapp/controller/action](http://localhost/myapp/controller/action))  
and thus I am unable to access it from remote location.

---

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [November 7, 2007, 6:03pm UTC](https://www.ruby-forum.com/t/links-always-go-to-localhost/119479/2 "2007-11-07T18:03:26Z")

</div>

In your apache configuration, make sure you have used the following:

ProxyPreserveHost on

Otherwise, when you do your proxying, Apache will simply issue a get  
and all the requests will appear to be entered as [http://localhost](http://localhost),  
which is why all of your links are coming back that way :-).

On Nov 7, 1:35 am, “Vapor …” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
