2

I have a bit of a strange setup (I think)(I'm fairly new to Magento and webservers). I have Magento installed on a webserver in-house and I want to access it from the LAN IP address rather than having to use the domain name and have the traffic go out to the internet then come back. When I put in the IP it redirects me to the domain name.

(edit) Sorry I wasn't clear - I still need to use the domain name to access the site from outside the network, and when I change the base URL to the IP address I can't get to the site from outside the LAN.

Changing the hosts file does work though...completely slipped my mind.

Ethan Mead
  • 63
  • 1
  • 6
  • 2
    This question appears to be off-topic because it is not about magento in particular – Marius Jul 24 '14 at 16:52
  • This question is off-topic because it is about networking. You might try setting up internal DNS to route the domain to the internal IP though. – davidalger Jul 24 '14 at 21:51
  • Or just kludge your local workstation hosts file to point to your internal server's ip address with the domain name you wish to use. Ain't that strange, in fact rather common setup. Nice to see you've got your own internal crash server so you're not posting here in a panic because you dev'd on the live e-commerce server. – Fiasco Labs Jul 25 '14 at 02:28

1 Answers1

3

Welcome to Magento.SE! There are two ways to do this:

Via admin

If you're able to update the website domains (you can access the admin panel) then I would suggest you log in to System > Config > Web:

enter image description here

Change this to be your internal IP address, e.g. http://192.168.59.240. Don't forget to update the cookie domain as well.

Via database

If for some reason you're unable to access the admin panel now you should update the URL via your database in the core_config_data table. To find the ids to update:

select * from core_config_data where value like '%yoursite.com%';

And then run an update against those. Don't forget to update the cookie domain as well.

philwinkle
  • 35,751
  • 5
  • 91
  • 145