Im running MAMP on my computer, is it possible to change the url text from 'localhost' to my local IP? If I enter the IP instead of localhost it works, so I just need to stop MAMP rewriting this.
The reason I need this is for testing on different browsers. I have old versions of IE on some spare computers and Im connecting to my localhost over my local network. If I type in my local IP address I can get the site. However the problem is that im using pathlogic, which creates absolute urls.
So the url for my site on my main computer is this:
http://localhost/newsite/
And I can connect to it over the network with this:
http://My Local IP Number/newsite/
The only problem is urls created by pathlogic are this:
http://localhost/newsite/imagesfolder/image1.jpg
When I connect over the network they need to be this:
http://My Local IP Number/newsite/imagesfolder/image1.jpg
So I can see the site, but urls to images created by pathlogic are wrong.
I know this isnt strictly a drupal question, but the last time I posted a question in the MAMP forums was a year ago, and its had hundreds of views but no answers!
Thanks
Comments
I am not familiar with MAMP,
I am not familiar with MAMP, but in WAMP there is option "go online". By checking this you can use it in local connection. So try to find the same option is in MAMP. If yes plz share with us. Hope this will help you a bit.
I cant see this option.
I cant see this option. Thanks
Try editing hosts file
Some steps to setting up a proper virtual host, which seems like your problem:
1) If you are using something like MAMP locally, check the apache httpd file to setup a virtual host:
MAMP/conf/apache/httpd.conf2) Add a new virtualhost record to the bottom, something like this:
3) Get your local ip - in terminal type:
ifconfigIt will be the inet number 10.10.0.### (where ### is like 245 depending on your router)
4) Type the following into your terminal:
sudo vim /etc/hostsYou can now define and edit the host IP addresses with Vim. Just create a new title with the local ip followed by the server name:
serverx.test 10.10.0.245(Using Vim, type 'i' to insert a line, then click escape key and type 'wq' (write + quit)
5) Reboot your Apache server in MAMP, go to a browser and type:
serverx.textThat should standardize the paths on your local environment and fix your issue.
Ive found a simpilar way that
Ive found a simpilar way that works for me. If I change localhost to my ip while logged in as admin and flush the cache then the site's base path gets changed to the ip number from localhost.