How To Direct Magento installation path in subfolder to main domain name

萝らか妹 提交于 2019-12-03 03:33:42

In System > Config > Web you will find the following settings for your 'base url'. To update this you will have to perform the following 3 steps:

Step 1: Set the default store to the proper base url

Notice that the base url has the subfolder defined.

Step 2: Set your STORE VIEW base url to the root url

Using your dropdown on the left, change the "Current configuration scope" to your store view [NOT DEFAULT]

To change the base url value, uncheck 'use website' and enter your new base url:

Also, double-check in the same screen that your Session file management cookie path is set to the root folder of your site and that the domain is correct:

Step 3 [also used for multiple store management]

Finally, and this is important, you need to copy the index.php file, .htaccess file, and symlink your media,skin and js folders to your root directory, because they're only available to your subfolder Magento base install right now - we need to let your main domain know where to look for Magento!

From secure shell in your Magento installation directory (in your case, mag) as sudoer:

sudo cp index.php ../
sudo cp .htaccess ../
sudo ln -s js ../
sudo ln -s skin ../
sudo ln -s media ../

Your admin will still be available at yoursite.com/mag/admin.

Edit your index.php file in this main webroot (the file you just copied) and update it around line 45:

$mageFilename = 'app/Mage.php';

Change this to :

$mageFilename = 'cart/app/Mage.php';

Where 'mag' is the subfolder. In your case you'd use the folder named 'mag'. Finally, you need to clear the cache for these changes to take effect.

Step 4: Multi-store [optional]

If you have more than one store, they can all be served this way, but you need to edit the index.php file to give it the correct store code. More info about that can be found here:

http://www.magentocommerce.com/knowledge-base/entry/overview-how-multiple-websites-stores-work

i must say that figuring out how to symbolic link was a hassle and i still couldnt figure it out. All the other steps worked fine except i copied my htaccess and my index.php and i just pasted it to my root. So for those who are having trouble, i found a better solution instead of symbolic link for "media, skin and JS" folders. In your magento admin. System>config under general click web. just change your base skin, media and js to the folder you want them to point to...

ex: {{unsecure_base_url}}cart/skin/

worked for me. Hope it works for anyone with the same problem. Ohh and im using magento 1.8.1 Thanks again @philwinkle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!