0

Is it possible to have magento in a subdomain but have the main index.php in the main domain.

So I have www.mysite.com and users come to this url when they click on a menu link eg shoes they are taken to store.mysite.com

2 Answers 2

1

Answer of your first question: Yes, it's possible, you need to edit index.php & find the line

define('MAGENTO_ROOT', getcwd());

change getcwd() to your sub-domain path


if you want to create a sub-domain store using magento following link could help you: http://www.crucialwebhost.com/kb/how-to-setup-multiple-magento-stores/

0

You may put your site subdomain/directory & main domain may use as landing page. add below code topmost of header.phtml

if (!isset($_COOKIE['firsttime'])){
    setcookie("firsttime", "no" );// EXPIRE     $getMegBaseUrl=Mage::getBaseUrl();
    header('Location: '.'http://www.landing.com/index.php');
    exit(); }

for landing page another directory/folder

if (!isset($_COOKIE['firsttime'])){
    setcookie("firsttime", "no" );// EXPIRE 
    $getMegBaseUrl=Mage::getBaseUrl();
    header('Location: '.$getMegBaseUrl.'landing/index.php');
    exit();
}

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.