Hi John,
Glad the iframe is getting you through. I thought it worthwhile to see what was what with the original idea from Magento. Actually, I think it’s sound, and may be able to suggest what’s going wrong.
The whole key is that any ‘path’ information following the ExpressionEngine root directory index.php is actually going to be treated as EE routing information, rather than filesystem paths. So anything that gets you consistently to that root directory, and critically its index.php file, should work.
I now understand what Magento is doing, in using its 404 handler to send any pages it doesn’t recognize to EE, and it is doing so by repathing those to the /ee/ directory.
The key to making it operate is in that .htaccess file they post at the top of the article. That .htaccess has to be in the /ee/ directory, by their layout, so that it can properly instruct the webserver. Then a request which tries to use the /ee/ directory is going to have index.php prepended to it.
This will cause the filesystem ‘pathing’ to stop, and EE will now use what’s left of the path, on executing the index.php, as normal routing within EE. That means your appropriate template group and template will be found—or the default index template in the default template group, if there is no routing after the /ee/ in the calling path.
EE then works as it’s used to working when it receives its index.php call, and has no idea Magento is there, save for the fact that they had you design the EE pages to include the Magento header menus so that you can transparently click and go to a place in Magento.
I know this overall Magento-proposed method works because it parallel to what I and others use in the so-called ‘old method’ of multiple site management, so that we can for example run a number of in-development EE sites off one EE executable. I’ll pass you a URL in a private message which you can apply as follows, and see it work:
—use the URL alone, and you get my current if on-hold and not publicized main site
—use URL/ae, and you’ll get an EE showing just the Agile Records demo—which is targetted by the index.php in the /ae directory, just like your Magento workup uses an /ee directory. This no-extra-paths case is the result of just adding the index.php without routing, as my .htaccess does similarly to Magento’s.
—use URL/ae/about, and you will see the Agile demo About page, properly, as if you’d pathed siteroot/about.
—use URL/ae/about/contact, and you’ll see the Agile contact page, properly, in the same way. The Agile demo has its contact page pathed/routed under the about template group, just so there’s clear understanding of what’s going on there.
Thus what I am suspecting is going wrong for you is that your /ee/.htaccess isn’t set up properly according to the Magento article—or maybe it isn’t there at all, or is placed in another directory through misunderstanding. The one other possibility that comes to mind is that mod_rewrite isn’t installed on your Apache server, or equivalent, but usually such a thing is present, and that .htaccess is not a stressful one.
As with my site, you should be able to test and debug all this by direct URL from browser, without Magento involved. Afterwards, the Magento handler in the article should work as expected.
They talk about handling real 404s - mis-addressed pages, at the end of the article. In their method, EE will actually be handling those, and that’s likely a much easier thing to set up however you would like it to look and act by EE normal methods, than anything external as they suggested might extend their method.
Hoping this will get you there - it’s simpler even than I thought, and saved me from having to invent substituting regular expressions for this, as had started to.
We’ll be interested to learn what you find—and very likely useful for others, John.
Regards,
Clive