cancel
Showing results for 
Search instead for 
Did you mean: 

localhost - 127.0.0.1 for multiple websites/stores

localhost - 127.0.0.1 for multiple websites/stores

Hi all.....

I'm trying to set up multiple websites/stores locally.

I have XAMPP installed on a Windows machine and can set up a single site without issue.

On my live server, i run multiple websites using the method below:

How could i use this same method on my local machine?

I access a single local website using 127.0.0.1/magento (magento being the default folder under htdocs/

 

switch($_SERVER['HTTP_HOST']) {
case 'website1.co.uk':
case 'www.website1.co.uk':
Mage::run('website1', 'website');
break;
default:
Mage::run();
break;
case 'website2.co.uk':
case 'www.website2.co.uk':
Mage::run('website2', 'website');
break;
default:
Mage::run();
break;
}

 

Thank you in advance

Andy

1 REPLY 1

Re: localhost - 127.0.0.1 for multiple websites/stores

Hi,

You could setup multiple virtual hosts in your apache config and have 2 copies of Magento, both pointing to the same database and each with their own unique index.php created.

 

To avoid having 2 seperate copies of the files too.. you could create a symlink in PowerShell to your main folder.

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner