Workout :
1) Created new folder in Root folder named usa,
2) Copy index.php and .htaccess from root folder and moved to usa folder
3) Created symbolic links to usa folder, usa symbolic links are,
C:\wamp\www\first_store>mklink /d ..\first_store\usa\app.\app
C:\wamp\www\first_store>mklink /d ..\first_store\usa\pub.\pub
C:\wamp\www\first_store>mklink /d ..\first_store\usa\lib.\lib
C:\wamp\www\first_store>mklink /d ..\first_store\usa\var.\var
4)usa index.php,
Set values for the MAGE_RUN_TYPE and MAGE_RUN_CODE
Open the index.php file under application root directory
Replacing this code: $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
by these codes:
switch($_SERVER['HTTP_HOST']) {
case 'http://127.0.0.1:8080/first_store':
$mageRunCode = 'base';
$mageRunType = 'website';
break;
case 'http://127.0.0.1:8080/usa':
$mageRunCode = 'usa_website';
$mageRunType = 'website';
break;
}
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = $mageRunCode;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = $mageRunType;
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
5) usa .htaccess file,
## enable rewrites
Options +FollowSymLinks
RewriteEngine on
SetEnvIf Host .*http://127.0.0.1:8080/usa/.* MAGE_RUN_CODE=usa_website
SetEnvIf Host .*http://127.0.0.1:8080/usa/.* MAGE_RUN_TYPE=website
6) Store configuration,
7) after run 127.0.0.1:8080/usa return 404 error , how can i solve this issue?