HowMultiple Website Store call in sub folder of main magento installation directoy with same bakend.
Index.php
$mageFilename = '../app/Mage.php';
require_once $mageFilename;
/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'abc';
/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'website';
Mage::run($mageRunCode, $mageRunType);
.htaccess File is:
RewriteCond %{REQUEST_URI} ^/abc/$
RewriteRule .* - [E=MAGE_RUN_CODE:store]
RewriteCond %{ENV:REDIRECT_MAGE_RUN_CODE} (.+)
RewriteRule .* - [E=MAGE_RUN_CODE:%1]
But then after category URL go to 404 page.
Website1 => Store => English , Chinese , USD ( www.abc.com )
Create new Website2
Website2=> Store => Chinese ( www.abc.com\website2chinese\)
"website2chinese " => This is subfolder of magento installation root path.
We need to call www.abc.com\website2chinese\ and now it's displayed 404 page when we click on any category link.
Ok, let’s say you want store url to be handled this the below way:
http://www.abc.com/website2chinese/ assuming it website_1
Next step for you to go in your Magento directory and make this directory, for example “website_1”
Copy .htacces and index.php from your root directory in each of those new directory.
In .htaccess search for “RewriteBase /” line and replace it with “RewriteBase /website_1/” inside "website_1" directory.
In this directory, open index.php and change “$compilerConfig = ‘includes/config.php’;” to
$compilerConfig = ‘../includes/config.php’;
Change $mageFilename = ‘app/Mage.php’; to $mageFilename = ‘../app/Mage.php’;
In same file make sure to edit Mage::run() function for each site:
Mage::run(‘website_1’, ‘website’);
Next step is to go to System->Configuration and select Current Configuration Scope to Website 1.
You have to set absolute paths to your skin, js and media directories like set Base URL = http://www.abc.com/website2chinese/
Hope this will help you !
Hi @Ashish_k_php,
You can get that kind of url's uysing store codes.
Maybe I'm not being able to understand what the problem is?
@Ravindra Pratap wrote:
Ok, let’s say you want store url to be handled this the below way:
http://www.abc.com/website2chinese/ assuming it website_1
Next step for you to go in your Magento directory and make this directory, for example “website_1”
Copy .htacces and index.php from your root directory in each of those new directory.
In .htaccess search for “RewriteBase /” line and replace it with “RewriteBase /website_1/” inside "website_1" directory.
In this directory, open index.php and change “$compilerConfig = ‘includes/config.php’;” to
$compilerConfig = ‘../includes/config.php’;
Change $mageFilename = ‘app/Mage.php’; to $mageFilename = ‘../app/Mage.php’;
In same file make sure to edit Mage::run() function for each site:
Mage::run(‘website_1’, ‘website’);
Next step is to go to System->Configuration and select Current Configuration Scope to Website 1.
You have to set absolute paths to your skin, js and media directories like set Base URL = http://www.abc.com/website2chinese/
Hope this will help you !
Already done this thing but still displayed 404 page if any category or link click time.
Ok, By the way have you tried below solution:
https://magento.stackexchange.com/questions/35539/page-not-found-when-click-on-category-link