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/
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
  • This is the correct way. Inside us folder you need to make var,media,lib,app symlinkd link to root folder corresponding – Suman-PHP4U Mar 22 '16 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 Mar 22 '16 at 18:53
  • I dont quite understand I have read a lot but I need the exact steps to get those syslink as i dont want to break the live website as the same time. – damek132 Mar 23 '16 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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