# Servername v. IP as domain name

**URL:** <https://www.ruby-forum.com/t/servername-v-ip-as-domain-name/125739>\
**Category:** Rails\
**Created:** [January 11, 2008, 4:37pm UTC](https://www.ruby-forum.com/t/servername-v-ip-as-domain-name/125739 "2008-01-11T16:37:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@anthony](https://www.ruby-forum.com/u/anthony)\
**Post date:** [January 11, 2008, 4:37pm UTC](https://www.ruby-forum.com/t/servername-v-ip-as-domain-name/125739/1 "2008-01-11T16:37:31Z")

</div>

When I navigate to my page using the server IP address, everything  
works perfectly. When I navigate to the page using servername,  
everything works fine except for the Ajax calls. I get the error,  
“This page is accessing information that is not under its control.”  
Apparently this is because servername and IP address are being  
considered different domains. Does anyone know how I can set the  
application up so that using servername will always work?

---

<div class="post-metadata">

**Author:** ![anthony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@anthony](https://www.ruby-forum.com/u/anthony)\
**Post date:** [January 11, 2008, 5:16pm UTC](https://www.ruby-forum.com/t/servername-v-ip-as-domain-name/125739/2 "2008-01-11T17:16:56Z")

</div>

On 11 Jan 2008, at 15:37, Anthony wrote:

> When I navigate to my page using the server IP address, everything  
> works perfectly. When I navigate to the page using servername,  
> everything works fine except for the Ajax calls. I get the error,  
> “This page is accessing information that is not under its control.”  
> Apparently this is because servername and IP address are being  
> considered different domains. Does anyone know how I can set the  
> application up so that using servername will always work?

sounds like you’re hitting the single origin policy. When you access  
your page using a host name, are all the links, includes of javascript  
files, ajax requests etc… using that name (and not the ip address) ?  
Or to put things another way, don’t mix names & ip addresses, you’ve  
got to 100% one way.

Fred

---

<div class="post-metadata">

**Author:** ![anthony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@anthony](https://www.ruby-forum.com/u/anthony)\
**Post date:** [January 11, 2008, 5:36pm UTC](https://www.ruby-forum.com/t/servername-v-ip-as-domain-name/125739/3 "2008-01-11T17:36:19Z")

</div>

I haven’t mixed names and ip addresses. I am finding the error on  
things such as form posts. I am using a form\_remote\_tag with :update.  
When I use the ip in the url, everything is fine. When I use  
servername, I can get to the page and form fine, but the :update isn’t  
firing. Rather, I get the specified error in IE, nothing in FF.
