I have a store set on a different domain to my main magento installation. I then have stores in sub-folders using the second domain e.g.
- maininstall.com
- aliasdomain.com
- aliasdomain.com/store1
- aliasdomain.com/store2
etc...
Now I added the nginx code to get my aliasdomain working in the root in my .conf
map $http_host $MAGE_RUN_CODE {
aliasdomain.com viewcode;
www.aliasdomain.com viewcode;
}
....
location ~ \.php$ { ## Execute PHP scripts
...
fastcgi_param MAGE_RUN_TYPE store;
fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE;
...
}
The aliasdomain.com works fine however the subfolders do not. Basically upon opening one in browser it all works fine, but clicking onto ANY page / product in that store causes a redirect back to "aliasdomain.com" with no subfolder.
I have not added nginx configuration for these stores as there is no need they all have their own index.php with the following in:
$mageRunCode = 'viewcode2';
$mageRunType = 'store';
Mage::run($mageRunCode, $mageRunType);
Does anyone know what could be causing this behaviour? I am stumped! This worked fine on Apache and I have just moved to nginx but can't see why the homepage would load (the store code is working) but then subsequent pages don't.
I have "Auto Redirect to BASE URL" set to Yes (302) in the backend (which was working fine on Apache) and if I turn it off the pages load the correct url e.g. aliasdomain.com/store1/page1 but I get a 404. Thought that was worth noting!
Thanks in advance!
EDIT:
I just found going into the store backend and setting "Use webserver rewrites > No" fixes the issue.
The problem is I am sure I need this ticked to yes, does this narrow down where my problem lies?
Thanks!