1

We have a multistore setup correctly, however I need to assign correct urls via symlinks.

  • Default Store: example.co.uk
  • Language Page: example.com
  • USA Store: example.com/us/

Under the root .htaccess I have the following:

SetEnvIf Host www\.example\.com/us/ MAGE_RUN_CODE=us_en
SetEnvIf Host www\.example\.com/us/ MAGE_RUN_TYPE=store
SetEnvIf Host ^example\.com/us/ MAGE_RUN_CODE=us_en
SetEnvIf Host ^example\.com/us/ MAGE_RUN_TYPE=store

I have also created a directory '/us/' and within I have index.php and .htaccess.

$compilerConfig = '../includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

$mageFilename = '../app/Mage.php';
$maintenanceFile = '../maintenance.flag';
$ip = $_SERVER['REMOTE_ADDR'];

$mageRunCode = 'us';
$mageRunType = 'store';

Mage::run($mageRunCode, $mageRunType);
}

What the website is missing is the content images, css and js, I have seen that this can be achieved via symlinks now how do I go about creating that for .com/us/ folder. Please note that the root dir is:

/home/example/public_html/

2 Answers 2

3

one way to handle this would be

  1. create a public folder into your magento root
  2. inside that public folder you can create your subfolders us, nl
  3. and inside of those subfolders you can clone index.php and .htaccess files and create symlinks to ../../skin, ../../errors, ../../media
  4. at this point you can edit .htaccess freely and index.php freely to set your store scope and include the right resources and you can safely commit this to version control as you are not affecting any core files and can manage all configurations from one place.
  5. optionally you can hide the whole magento root folder out of public_html folder on your server where domain is pointed and just symlink the folders (ln -s /path/to/public/us us/) to this destination
2
  • This is the correct way. Inside us folder you need to make var,media,lib,app symlinkd link to root folder corresponding Commented Mar 22, 2016 at 17:06
  • no you won't need to symlink those folders as .htaccess, index.php skin, errors and media are the only files/fodlers you minimally need to expose to public
    – Anton S
    Commented Mar 22, 2016 at 18:53
0

Hi I have setup 3 sub directories for my stores and added symlinks each with app, pub, var, lib folders.

ex: /root/store1 (/app, /pub, /var, /lib ) /root/store2 (/app, /pub, /var, /lib ) /root/store3 (/app, /pub, /var, /lib )

However, there's no way to edit the css style of /root/store1/css separately style with other stores. Everytime, I edit store1 css, the rest of the stores also edited automatically.

I wanted to have 3 stores with different styles in the frontend. How do I achieve this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.