2

I am trying to understand why when I type in a url address that is for a development server my browser changes it to an IP? In the top of my host files I have something like 11.111.111.11 devserver.

I can access the base url just fine, but when I go to devserver/page/index.php it turns it into an address like such 11.111.111.11/page. I think it has something to do with the host files or the fact that I use a VPN (Cisco IPSec) to access the development server. Could this be the reason why? I can't find any information on people having similar issues.

All my host files in /private/etc/

hosts                                 
hosts.equiv                          
hosts.mamp.bak                       
hosts.save                            
hosts~orig   
1
  • This problem can't be related to the hosts file as the HTTP protocol does not know about domains and IP addresses until the browser tells it the domain name as the second line of an HTTP/1.1 request.
    – davidgo
    Feb 23, 2013 at 8:06

1 Answer 1

3

Your development server (or the PHP script) is changing the URL while routing/redirecting your request. Look through your PHP code or .htaccess file (or equivalent configuration file) to verify if the server IP address is hard-coded into any variable or URL string.

2
  • It might also be hardcoded in <Host> or <VirtualHost> settings of Apache.
    – Arjan
    Feb 23, 2013 at 8:21
  • Everything works great from my Windows work computer just my Mac is causing an issue remotely. If the IP was hardcoded wouldn't all computers that are trying to access it change the URL to the IP?
    – dnelson
    Feb 23, 2013 at 19:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .