I know there are bunch of articles for this, but it actually does not work for this client. Specifically now I need 2 websites to run
Here is my setup:
.htaccess
... SetEnv MAGE_RUN_TYPE website SetEnv MAGE_RUN_CODE base SetEnvIf Host .*wholesale.* MAGE_RUN_CODE=wholesale SetEnvIf Request_URI "(wholesale)" MAGE_RUN_CODE=wholesale ... <IfModule mod_rewrite.c> ... RewriteCond %{HTTP_HOST} .*wholesale\.* [NC] RewriteRule .* - [E=MAGE_RUN_CODE:wholesale] RewriteCond %{REQUEST_URI} ^/wholesale RewriteRule .* - [E=MAGE_RUN_CODE:wholesale] RewriteCond %{ENV:REDIRECT_MAGE_RUN_CODE} (.+) RewriteRule .* - [E=MAGE_RUN_CODE:%1] ...
No modifications to index.php (update: I won't do any changes to index.php file as it's not needed, the file itself may be overwritten by one of updates from Magento Core team and actually it won't help)
Directory structure on doc root:
root@xxx [/home/devserver/public_html]# ls -la drwxr-x--- 9 devserver nobody 4096 Dec 8 09:25 ./ drwxr-xr-x 14 devserver devserver 4096 Nov 26 23:07 ../ ... drwxr-xr-x 14 devserver devserver 4096 Nov 22 03:25 store/ lrwxrwxrwx 1 devserver devserver 25 Nov 26 23:10 wholesale -> /home/devserver/www/store/ ...
Whenever I open the homepage the content is shown, but the secure pages like: https://DOMAIN_NAME/wholesale/customer/account/login/ leads to 404
After investigation I found that MAGE_RUN_CODE and MAGE_RUN_TYPE are good, but there is a problem in getting the controller app/code/core/Mage/Core/Controller/Varien/Router/Standard.php:121), basically the method setBaseUrl is getting $_SERVER['SCRIPT_NAME'] and generates Base Url out of it, which is "/store/" for both symbolyc link and base directory our of doc root.
Is there something wrong with my setup or should I go this way https://stackoverflow.com/questions/9199854/how-do-i-override-mage-core-controller-request-http?
UPDATE:
- A separate directory which stores the same data helps. Is there a way to say apache to overwrite SCRIPT_NAME for specific website/store/storeview ?