Magento Forum

   
Page 1 of 3
Multiple Store Redirect Problem After 1.4 Upgrade
 
winterradio
Sr. Member
 
Total Posts:  84
Joined:  2008-02-01
 

After installing the 1.4 update, I managed to finesse my way through all of the problems that arose.

However, my multistore setup became broken (All of my websites on seperate domains are redirecting to my domain1.com shop instead of using just the path/to/app/Mage.php).  I initially setup vhost.conf/vhost_ssl.conf for virtual domains under domain1.com:

<Directory /var/www/vhosts/domain2.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir none
</Directory>

After the install, it seems index.php has changed considerably.  I assumed :

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

would mirror:

umask(0);
Mage::run(’code’, ‘website’);

as provided in the previous index.php file

I assumed this was related to the open_basedir exception already made as an exception in the vhost.conf/vhost_ssl.conf files previously mentioned.

I’ve gone into http.conf at root, I’ve tried to manipulate .htaccess, index.php, etc. to no avail.  I had multiple domains running under one admin install working perfectly until the upgrade.

domain1.com is running under the same deprecated files as the rest of the domains(2,3,4).

I tried replacing the updated .htaccess and index.php on domain1.com, no luck.

If anyone else is running multiple domains and has run into this problem please let me know, thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Roger
Member
 
Total Posts:  69
Joined:  2007-08-31
 

Can you get into admin or does it just redirect to shop1?

If so it is similar to my problem, http://www.magentocommerce.com/boards/viewthread/77814/

 
Magento Community Magento Community
Magento Community
Magento Community
 
winterradio
Sr. Member
 
Total Posts:  84
Joined:  2008-02-01
 

No problem with admin, just /path/to/app/Mage.php redirects to the main installation folder (domain1.com).  Before I conquered this problem previously I would be met with a /path/to/app/Mage.php not found error.

I was never redirected.  It seems some of the architecture may have changed although I find it hard to believe it is server related with the exception provided and working fine.  It seems odd that app/design/frontend/default/domain2 or skin/frontend/default/default/domain2 would throw exceptions.

Perhaps it is related to the new “base” folders?

 
Magento Community Magento Community
Magento Community
Magento Community
 
winterradio
Sr. Member
 
Total Posts:  84
Joined:  2008-02-01
 

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
 
cavalierlyon
Jr. Member
 
Total Posts:  18
Joined:  2008-11-27
 

Hi,

I had the same probleme and I changed the index.php by the index.php before upgrade.

Sorry for my english

Frank

 
Magento Community Magento Community
Magento Community
Magento Community
 
hillzzz
Jr. Member
 
Total Posts:  8
Joined:  2009-01-30
Southampton UK
 
winterradio - 17 February 2010 11:44 PM

After installing the 1.4 update, I managed to finesse my way through all of the problems that arose.

However, my multistore setup became broken (All of my websites on seperate domains are redirecting to my domain1.com shop instead of using just the path/to/app/Mage.php).  I initially setup vhost.conf/vhost_ssl.conf for virtual domains under domain1.com:

<Directory /var/www/vhosts/domain2.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir none
</Directory>

After the install, it seems index.php has changed considerably.  I assumed :

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

would mirror:

umask(0);
Mage::run(’code’, ‘website’);

as provided in the previous index.php file

I assumed this was related to the open_basedir exception already made as an exception in the vhost.conf/vhost_ssl.conf files previously mentioned.

I’ve gone into http.conf at root, I’ve tried to manipulate .htaccess, index.php, etc. to no avail.  I had multiple domains running under one admin install working perfectly until the upgrade.

domain1.com is running under the same deprecated files as the rest of the domains(2,3,4).

I tried replacing the updated .htaccess and index.php on domain1.com, no luck.

If anyone else is running multiple domains and has run into this problem please let me know, thanks.

I have the same problem. I have multiple domains each with a separate IP address, The web root and document root directories are sub directories of the Magento directory. Each Domain has its own index.php and .htaccess files in its web root.

it all worked fine before the upgrade. Now whatever domain is requested the default magento site is served. Prior to the upgrade all the domains had a separate theme and this is also broken.

None of the configuration settings to do with url redirects in the admin control panel seem to have any effect on the problem.

originally my index.php files looked like this:

umask(0);
Mage::run(’designerjewellers’,’website’);

Now they look like this:

umask(0);

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

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

I cannot see where to set the variables in the new index.php to re-create the multiple domains I had working under 1.3.

I need to get these sites running again asap and so I would be really grateful for any pointers.

Thanks,

Hillary

 
Magento Community Magento Community
Magento Community
Magento Community
 
winterradio
Sr. Member
 
Total Posts:  84
Joined:  2008-02-01
 

These should be the new settings:

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

Look at my above post about the url setting in the admin as well.  That one little checkbox was screwing everything up for me.

Also, make sure your permissions and file ownership are shared across all domains.

Let me know if this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cabazo
Jr. Member
 
Total Posts:  1
Joined:  2010-02-22
 

http://www.magentocommerce.com/wiki/general/multiple-website-setup#virtualhost_solution

 
Magento Community Magento Community
Magento Community
Magento Community
 
hillzzz
Jr. Member
 
Total Posts:  8
Joined:  2009-01-30
Southampton UK
 
winterradio - 22 February 2010 10:43 AM

These should be the new settings:

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

Look at my above post about the url setting in the admin as well.  That one little checkbox was screwing everything up for me.

Also, make sure your permissions and file ownership are shared across all domains.

Let me know if this helps.

Hi This solution does indeed work. James Baliotti of iPic Publishing also mailed me the same answer so thank you to both of you. Curiously however setting “Redirect to Base URL if requested URL doesn’t match it” to yes in the admin control panel does not seem to cause a problem on my site although I have not tested it extensively yet. But it appears to work happily with that set to yes.

Regards and thanks to all who helped.

Hillzzz

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

Hi,

Thanks for this post, I almost lost my hairs on that.

It works for me to get to my new website but now I can get to my base website! or to other websites!
So how to configure for multi websites?

Regards.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Alexander Pervak
Jr. Member
 
Total Posts:  24
Joined:  2009-09-15
Kiev
 

See also http://www.magentocommerce.com/blog/comments/from-the-support-team-multi-site-domain-name-setup/

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

I have magento installed in a shared hosting.
So I can access the .htaccess file.
I have a parked domain tha points in the root directory.
As thisn says:http://www.magentocommerce.com/wiki/general/multiple-website-setup#multiple_websites_on_magento_1.4_single_installation
the only thing I have to do is add the following code at the .htaccess file.

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

That’s what I did and also I have changed the base url for my new website from the admin panel.

So why isn’t it working?

I hope someone can help me with his knowledge!

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

Hi,

1- Your “Main Website” is working find, right?

2-You want to add a second “New Website” , right?

3- We are talking about WEBSITES not STORES, right?

Please reply those 3 questions.

Regards

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

yes to all 3 questions!
and also I am talking about a new website in a new parked domain.
thank you

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

Here is the solution.

1 - In admin / System / Configuration / (in the left column, on the top you have “Current configuration scope” It should be “Default Config"),Down go to TAB:  / WEB / (in the list from the right, in the first TAB: URL OPTIONS ), set “Redirect to URL Base URL if requested it does not match “to NO. See image attached.

2 - Add the following at the bottom of your file “htaccess” in your Magento root installation.

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

Attention;
“newebsite.com” is the new domain name, example: (http://www.newwebsite.com).
and
“newebsite” is the code of your new “website” in the Magento admin.

See image attached.

3 - Change the file “index.php” (+ / - line 75) located is your Magento root installation, like this:

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

In the original file, the last line of the “index.php” ends with “store”, so the only thing to change in this “index.php” is store to website.

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.

Flush Magento Cache.

Now you just have to point your new website like this: www.newwebsite.com/magento (magento if your root folder is called magento of course).

I did translate from my french post so I attach the french image from the admin.

Hope this helps.
Good luck

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

well… when I changed Redirect to URL Base URL to NO and then my new domain pointed its main page!!! but when I clicked at another link then it linked again to the main website.
Then I have put the code at the .htaccess and also changed from store to website at the index.php but finally I got a “500 - Internal Server Error” at all pages including the main website. Then I have cut the code from the .htaccess and the main website works fine again.

I think I am half way to the solution. Do you have any idea what I might be doing wrong?

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