Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 3
Multiple Store Redirect Problem After 1.4 Upgrade
 
conec
Member
 
Total Posts:  70
Joined:  2009-03-25
 

Is you Magento installation 1.4.0.1?
And did you Flush the cash?

Also, keep your New Website “Current Configuration Scope” Unsecure and Secure - Base URL and Base Link URL to “default , as it was after original installation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
aneguitar
Jr. Member
 
Total Posts:  26
Joined:  2009-09-10
Greece
 

I have set the Unsecure and Secure - Base URL and Base Link URL to “default for the new website.
when I did this nothing really happened, just the new website works correctly only for its main page.
Also I have put the code at the .htaccess and when I saved it everything stopped working again and a server error 500 appeared.
Also I flushed the cache and I have Magento installation 1.4.0.1.
Any other ideas?

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
aneguitar
Jr. Member
 
Total Posts:  26
Joined:  2009-09-10
Greece
 

Also I want to point out that I have a fresh install!

 
Magento Community Magento Community
Magento Community
Magento Community
 
conec
Member
 
Total Posts:  70
Joined:  2009-03-25
 

If I understand your base website is working ok and the main page off the new website as well. So what is wrong?
You can PM me your index.php an htaccess files, so I can have a look.

 
Magento Community Magento Community
Magento Community
Magento Community
 
conec
Member
 
Total Posts:  70
Joined:  2009-03-25
 

I see your mistake,

Look back at my explanation post!

If your new web site is: http://www.love.com, your modif in the htaccess should look like this:

RewriteCond% (HTTP_HOST) ^(.*) love.com
RewriteRule ^ - [E = MAGE_RUN_CODE: love]

---------------------------------------------------------------------

RewriteRule ^ - [E = MAGE_RUN_CODE:"here you have to put your new website code, look at my picture above"]

 
Magento Community Magento Community
Magento Community
Magento Community
 
Thejosh13
Sr. Member
 
Total Posts:  252
Joined:  2008-06-23
 
winterradio - 18 February 2010 01:14 PM

After tearing my hair out located the problem at System-->Configuration-->General-->Web

Redirect to Base URL if requested URL doesn’t match it - should be set to no

This eliminates the redirect problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tapebrothers
Sr. Member
 
Total Posts:  96
Joined:  2008-05-14
 

I must be missing something do i just edit the root .htaccess and index.php or do i put a copy of both in each website folder like in ver 1.3?

thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paulus
Guru
 
Total Posts:  335
Joined:  2008-07-21
 
winterradio - 18 February 2010 01:14 PM

After tearing my hair out located the problem at System-->Configuration-->General-->Web

Redirect to Base URL if requested URL doesn’t match it - should be set to no

This eliminates the redirect problem.

Strange, we do not have that option anywhere:/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paulus
Guru
 
Total Posts:  335
Joined:  2008-07-21
 

my last comment is about v1.4.0.1, unlike what my sig might suggest wink

However, scratch it altogether i found it.

* Update: I now have the same issue as aneguitar has/had.

Mainpage is fine, all links point to ourinstall domain, like this:

www.install.tld

www.siteA.tld/dvds, would go to www.install.tld/dvds

I’m sure i have followed the right steps, such as:

1. changing www.siteA.tld/index.php
$mageFilename = ‘/www/pathto/mage14/app/Mage.php’;
...
$mageRunType = isset($_SERVER[’MAGE_RUN_TYPE’]) ? $_SERVER[’MAGE_RUN_TYPE’] : ‘da_code’;

2. At the bottom of our www.install.tld/mage14/.htaccess
RewriteCond %{HTTP_HOST} ^(.*)siteA.tld
RewriteRule ^ - [E=MAGE_RUN_CODE:da_code]

Has my day been this long that i do see the obvious error? Anybody?

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paulus
Guru
 
Total Posts:  335
Joined:  2008-07-21
 

Forgot:

3. Set Redirect to Base URL if requested URL doesn’t match it to “No”.

And an added issue:
The category root is not right, it stays stuck with the default store view’s categories.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sepp
Sr. Member
 
Avatar
Total Posts:  120
Joined:  2008-06-14
Hamburg
 

Hello
for me with plesk domain aliases it do not work
the old way works fine.

index.php:

umask(0);

#$mageRunCode = isset($_SERVER[’MAGE_RUN_CODE’]) ? $_SERVER[’MAGE_RUN_CODE’] : ‘’;
#$mageRunType = isset($_SERVER[’MAGE_RUN_TYPE’]) ? $_SERVER[’MAGE_RUN_TYPE’] : ‘website’;

#Mage::run($mageRunCode, $mageRunType);

switch($_SERVER[’HTTP_HOST’]) {
case ‘domain.com’:
case ‘www.domain.com’:
Mage::run(’domain_com’,’website’);
break;

default:
Mage::run();
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
ZwaZo
Jr. Member
 
Total Posts:  22
Joined:  2009-03-10
 
Paulus - 23 April 2010 09:39 AM

my last comment is about v1.4.0.1, unlike what my sig might suggest wink

However, scratch it altogether i found it.


* Update: I now have the same issue as aneguitar has/had.

Mainpage is fine, all links point to ourinstall domain, like this:

www.install.tld

www.siteA.tld/dvds, would go to www.install.tld/dvds


I’m sure i have followed the right steps, such as:

1. changing www.siteA.tld/index.php
$mageFilename = ‘/www/pathto/mage14/app/Mage.php’;
...
$mageRunType = isset($_SERVER[’MAGE_RUN_TYPE’]) ? $_SERVER[’MAGE_RUN_TYPE’] : ‘da_code’;

2. At the bottom of our www.install.tld/mage14/.htaccess
RewriteCond %{HTTP_HOST} ^(.*)siteA.tld
RewriteRule ^ - [E=MAGE_RUN_CODE:da_code]



Has my day been this long that i do see the obvious error? Anybody?

Thanks.

I have noticed that the variable {{store url=""}} is always pointing to the default website .tld.

:(

I still do not know why it behaves this way.

Best regards,

 
Magento Community Magento Community
Magento Community
Magento Community
 
M Floren
Jr. Member
 
Total Posts:  13
Joined:  2010-05-11
 

how do you use the following like of code with a sub domain.

RewriteCond %{HTTP_HOST} ^(.*)siteA.com
RewriteRule ^ - [E=MAGE_RUN_CODE:da_code]

if the site is located at store.siteA.com would it be

RewriteCond %{HTTP_HOST} ^(.*)store.siteA.com
RewriteRule ^ - [E=MAGE_RUN_CODE:da_code]

I have a working sub store when i use.

RewriteCond %{HTTP_HOST} ^(.*)siteA.com
RewriteRule ^ - [E=MAGE_RUN_CODE:da_code]

only when it is on the root domain, if it is located as a sub domain or in a folder. (siteA.com/store/ ) it does not work.

humm.

 
Magento Community Magento Community
Magento Community
Magento Community
 
j0yrid3r
Jr. Member
 
Total Posts:  1
Joined:  2010-04-28
 

I did this in a local installation to get the both the standard and mobile version active in 1.5.0.1 on a windows 7 machine (this should work in 1.4 too I guess)

In Magento
- created 2 stores in magento (the standard way)
- added the iphone template to the mobile store (the standard way)
- changed the Auto-redirect to Base URL to no (Default Options > Web > URL options)
- in index.php added the seperation the standard (old fashion) way:

if($_SERVER["SERVER_NAME"== "www.standardmag.dev")  Mage::run('base','website') ;
elseif(
$_SERVER["SERVER_NAME"== "www.mobilemag.dev")
Mage::run('mobile_base','website') ;
else 
Mage::run();

On my webserver (wamp, this was just to create 2 fictional domain names to work with)
- created 2 virtual host sections both pointing to the same magento folder, one called www.standardmag.dev the other called www.mobilemag.dev
- added both domain names to my hosts file pointing to 127.0.0.1
- restarted apache

now:
- www.standardmag.dev leads me to the normal site
- www.mobilemag.dev leads me to the mobile site

 
Magento Community Magento Community
Magento Community
Magento Community
 
Novusweb
Sr. Member
 
Avatar
Total Posts:  89
Joined:  2009-05-06
Texas
 

Y’know, we must have read every post we could on how to manage multiple websites, stores. Here’s what we add to the bottom of the .htaccess file:

SetEnvIf Host www\.[domain] MAGE_RUN_CODE=(code)

SetEnvIf Host www\.[domain] MAGE_RUN_TYPE=(type)
SetEnvIf Host ^[domain] MAGE_RUN_CODE=(code)
SetEnvIf Host ^[domain] MAGE_RUN_TYPE=(type)

Where (code) is the website or store code and (type) is either “website” or “store”. Works great for us on MageMojo and Hostgator, both. We don’t mess with the httpd.conf or the index.php files at all.

Furthermore, we’re able to manage dozens of Websites and Stores, all using a shared SSL certificate!

Took us a long time to find the “simple” cure, for us, but it works.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 3