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 3 of 3
Multiple Store Redirect Problem After 1.4 Upgrade
 
mikeonmage
Sr. Member
 
Total Posts:  101
Joined:  2011-02-03
 

odd timing I was just posting about this.

you gave this code:

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)

can you give me a hint as to what I would put the blanks above?

I am using 1 domain and the default website/view + the second one website/view i created.

I am not using site.com and site2.com

I am using just one url:

http://pro-tools-training.com/new-magento2/index.php/?___store=default

which is

---------> the default Store and View of http://pro-tools-training.com/new-magento2/

and the vip site

http://pro-tools-training.com/new-magento2/index.php/?___store=vip

which is

---------> the Store and View I created in admin, still using http://pro-tools-training.com/new-magento2/ as url - not a unique url

In Admin, with Configuration Scope set to vip:

it does not seem to matter the settings I still get same 404

i have tried all these combos:

http://pro-tools-training.com/new-magento2/
{{unsecure_base_url}}/vip/

http://pro-tools-training.com/new-magento2/vip/
{{unsecure_base_url}}/vip/

http://pro-tools-training.com/new-magento2/vip/
{{unsecure_base_url}}/

I only other thing would be the .htaccess,

can you instruct me what to add to you code example?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Novusweb
Sr. Member
 
Avatar
Total Posts:  89
Joined:  2009-05-06
Texas
 
mike - 23 March 2011 12:33 PM

odd timing I was just posting about this.

you gave this code:

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)


can you give me a hint as to what I would put the blanks above?

I am using 1 domain and the default website/view + the second one website/view i created.

I am not using site.com and site2.com

I am using just one url:

http://pro-tools-training.com/new-magento2/index.php/?___store=default

which is

---------> the default Store and View of http://pro-tools-training.com/new-magento2/

and the vip site

http://pro-tools-training.com/new-magento2/index.php/?___store=vip

which is

---------> the Store and View I created in admin, still using http://pro-tools-training.com/new-magento2/ as url - not a unique url

In Admin, with Configuration Scope set to vip:

it does not seem to matter the settings I still get same 404

i have tried all these combos:

http://pro-tools-training.com/new-magento2/
{{unsecure_base_url}}/vip/

http://pro-tools-training.com/new-magento2/vip/
{{unsecure_base_url}}/vip/

http://pro-tools-training.com/new-magento2/vip/
{{unsecure_base_url}}/

I only other thing would be the .htaccess,

can you instruct me what to add to you code example?

If I understand your situation, I would suggest the following:

SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_CODE=default

SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_TYPE=website
SetEnvIf Host 
^pro-tools-training\.com MAGE_RUN_CODE=default
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_TYPE=website

Then you could use www.pro-tool-training.com/new-magento2/ for your Base URL in the Default “Current Configuration Scope.”

You may want to consider setting up vip.pro-tools-training.com to allow a direct URL to your VIP Store view, as well. Use the same code in the .htaccess file (adding it to the above), but substituting vip.pro-tools-training.com for the domain names and setting vip.pro-tools-training.com as the Base URL for that Store View.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mikeonmage
Sr. Member
 
Total Posts:  101
Joined:  2011-02-03
 

1.

are you saying i would do this:

SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_CODE=default
SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_CODE=default
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_TYPE=website
SetEnvIf Host www\vip.pro-tools-training\.com MAGE_RUN_CODE=default
SetEnvIf Host www\vip.pro-tools-training\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_CODE=default
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_TYPE=website

and not this:

SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_CODE=default
SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_CODE=default
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_TYPE=website
SetEnvIf Host www\vip.pro-tools-training\.com MAGE_RUN_CODE=vip
SetEnvIf Host www\vip.pro-tools-training\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_CODE=vip
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_TYPE=website

2.

and I paste in at the end of htaccess without modifying anything else in htaccess?

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

Almost right:

SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_CODE=default 
SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_TYPE=website 
SetEnvIf Host 
^pro-tools-training\.com MAGE_RUN_CODE=default 
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_TYPE=website 
SetEnvIf Host vip
.pro-tools-training\.com MAGE_RUN_CODE=vip 
SetEnvIf Host vip
.pro-tools-training\.com MAGE_RUN_TYPE=store

I think this will work better for you.

The only other thing you need to be sure of in the .htaccess is that your REWRITE Base is correct for your deployment.

Sorry for the plug, but you might find some benefit from our new book, Managing Multiple Stores with Magento. It goes into much more detail about setting up multiple stores and strategies for doing that.

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

Correction:

SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_CODE=default 
SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_TYPE=website 
SetEnvIf Host 
^pro-tools-training\.com MAGE_RUN_CODE=default 
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_TYPE=website 
SetEnvIf Host 
^vip\.pro-tools-training\.com MAGE_RUN_CODE=vip 
SetEnvIf Host 
^vip\.pro-tools-training\.com MAGE_RUN_TYPE=store

Sorry. Forgot some escaping characters.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mikeonmage
Sr. Member
 
Total Posts:  101
Joined:  2011-02-03
 

thanks, the book is of interest because i am going to want to do quite a lot once I am up and running, trying to get over the first hurdle here

whatever i do, i will be using only one domain though.

so i am not 100% clear about Rewrite or the sub-domain.

1.

UPDATE:

OK i re-read what you said: “REWRITE Base”

so what I put before:

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

is not needed at all and

############################################
## you can put here your magento root folder
## path relative to web root

RewriteBase /new-magento2/

############################################

is what you meant?

so the total changes to htaccess would be:

############################################
## you can put here your magento root folder
## path relative to web root

RewriteBase /new-magento2/

############################################

SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_CODE=default
SetEnvIf Host www\.pro-tools-training\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_CODE=default
SetEnvIf Host ^pro-tools-training\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^vip\.pro-tools-training\.com MAGE_RUN_CODE=vip
SetEnvIf Host ^vip\.pro-tools-training\.com MAGE_RUN_TYPE=store

??

2.

re the sub-domain: is the purpose of the sub-domain purely to have the direct url and no folder creation or folder use will be in effect on the server or in Admin?

All I want to do with vip is make some pages “vip” viewable to vip users and I understand that is all done in Admin > create page > “set store view” and has nothing to do with server / sub-folders. I was going to also create a vip version of my theme for some minor cosmetic changes.

my package

my theme
my vip theme

but again, no sever-sub/folders right? all done in admin and the purpose of the sub-domain purely to have the direct url ?

UPDATE:

So far this has not worked for me. I am in 1.5.0.1. I am also not sure using a sub-domain will be good for SEO. I am doing more research and will post back.

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

It’s quite possible that your Base URL configurations are incorrect, as well. Also, when you say it’s not working for you, you should be more specific: what is not working?

In all sincerity, you may want to create a clean install of 1.5, follow the instructions in the book, and you should turn out just fine. Sometimes, if you keep trying things too much, you end up with a mess. I know I do.

One piece of advice. After you do your clean install, BEFORE you make any changes to any file, make a copy of that file as a backup. That way, if you do get down the road you and feel you need to go back to “zero,” you can simply use the copy of any files you’ve altered and avoid doing a complete re-install. Backup your db as well between sessions.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mikeonmage
Sr. Member
 
Total Posts:  101
Joined:  2011-02-03
 

to anyone who followed my posts here. it is very odd, but I have everything working with

NO htaccess modifications

NO index.php modifications

NO Admin > Configuration > Web modifications

only

Admin > Configuration > Design modifications.

--

urls =

site.com/?___store=default
site.com?___store=vip

--

The best method for me was to have my-modern as default theme, meaning the vip store will have the theme set my-modern-vip where only vip tweaks are pulled from my-modern-vip and all the other files are pulled from the my-modern.

So in the my-modern-vip I will be able to put only the files I need to be modified for the vip theme not all the my-modern files.

--

the rest consists of going back into Admin setting/re-setting your views/scope for e.g. blocks, pages, product , attributes, extensions, etc…

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

ok, so I was on 1.3 and moved to 1.4.1

3 Different Websites, 1 SSL domain for login and checkout.

All this originally worked and I could checkout and login ok.

Now I’ve tried some of these solutions however I’m still finding that when I login, the session is fine for login on the SSL domain, but returning back to the catalog under the other website domain name the session is lost again.

Not tearing hair out, as not too major as of yet, but I’d like to figure this out soon as to why I can no longer share the session after login.

 
Magento Community Magento Community
Magento Community
Magento Community
 
haijerome
Member
 
Avatar
Total Posts:  44
Joined:  2010-07-19
 

The solution by winterradio works great.

Thanks a lot !!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
bc28001
Jr. Member
 
Total Posts:  16
Joined:  2011-08-08
 

guys im having the same problem here is my site www.braboxshop.com

and i have two languages and i have two stores.
but when i click on the nav of one store it takes me back to the default one.
how can i prevent that from happening.

 
Magento Community Magento Community
Magento Community
Magento Community
 
designgroop
Jr. Member
 
Total Posts:  2
Joined:  2012-07-31
 

Hello,

In case this helps anyone..

I had terrible redirect problems. We’ve set up multiple stores and were testing fine as subdomains. We set up the live domains in Plesk, as per various tutorials but couldn’t get it to work with the ready-to-go site.

A fresh test of a secondary store and domain on the same install resulted on the 404 issue, despite correct configuration. However, coming back to it a day later on a different machine and - bizarrely - it was working.

This peculiar behaviour has led me to believe there is some kind of caching issue at work beyond the ‘flush cache’ or /var/cache files. I’ve also managed to prove it’s not related to htaccess or setting the store/type variables in index.php. Clearing browser data/cookies and core_sessions in mysql didn’t help.

The way I seem to have forced the correction is by reviewing the CMS page (set as default in the config for the domain that is causing problems) and hitting ‘preview’. This opens the page in a new window but with the domain in question in the URL. After this, the additional domain/store WORKS!!!!

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
To re-iterate, **there is a cached redirection that as yet seems undocumented**. This can be cleared by clicking on ‘preview’ for the default CMS page for the problematic domain/store.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Moving from OSCommerce, I thought Magento was awesome - but its complexity through caching is making me sick.

 
Magento Community Magento Community
Magento Community
Magento Community
 
designgroop
Jr. Member
 
Total Posts:  2
Joined:  2012-07-31
 

Go 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.

This has been suggested a few times. Unfortunately, this never made a difference, tried it many times under different circumstances. This only seems to affect a redirect when Magento doesn’t know where to route. It doesn’t help once Magento has begun caching its redirects.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sirtordo
Jr. Member
 
Total Posts:  1
Joined:  2012-10-08
 
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.

you are the best.

 
Magento Community Magento Community
Magento Community
Magento Community
 
prakharcse
Jr. Member
 
Total Posts:  1
Joined:  2013-08-19
 

I have developing a magento multistore. My store is having setup like:
www.abc.com
and second store is at:
www.abc.com/xyz

My problem is that how i will redirect it to different domains like:
www.abc.com
and
www.xyz.com

Please provide me solution for this problem.

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