Is it possible to use Magento and place it inside of another PHP framework like Yii in a subdirectory?

We are currently trying to place Magento in example.com/magento.

UPDATE 21/07/2015

We have managed to make it work but the problem is that the theme, css, js and template is not working or showing. do i need to update something to make it work? thankyou

UPDATE 22/07/2015

The problem regarding theme, css, etc not loading is because of the folder in the app/code. in the modules, it was declare as local, but the current file name is local1, so i change it to local and everything is fine..

UPDATE 23/07/2015

after fixing everything, i found another problem in here. the magento connect manager is not working. it only displays The page you requested was not found, and we have a fine guess why. do i need to configure anything? please help me.thank you

  • I believe it will be different installation, say two frameworks will live in own folders. The other question is do they need to communicate in some way? – Sharif Jul 17 '15 at 3:17
  • no, the php framework do not need to communicate with magento. – user3779015 Jul 17 '15 at 3:20
  • Regarding your update: Did you configure the base url in Magento to example.com/magento/ ? – Fabian Schmengler Jul 21 '15 at 6:24
  • If one of the answers helped you solve your original problem, please mark it as accepted – Fabian Schmengler Jul 22 '15 at 5:10

Yes. That's possible.
But you will need to uncomment this line from .htaccess.

#RewriteBase /magento/

And you have to make sure that your other application (build on Yii or something else) does not have urls mapped to the key magento.


There will be a conflict if the other framework rewrites all requests to /index.php (and most frameworks do this), so that the rewrite rules of Magento do not apply.

Find the line in your root /.htaccess

RewriteRule . index.php

And add this directly before:

RewriteCond %{REQUEST_URI} !^/magento

It will exclude all requests starting with /magento from the rewrite rule of your other framework (Yii)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.