PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, February 13, 2022

[FIXED] CakePHP2 coexising with CakePHP3 on same domain

 February 13, 2022     cakephp, cakephp-2.0, cakephp-3.0, nginx     No comments   

Issue

Let's suppose an application written in Cake2. This application is huge. This application is mainly about CRUD's. Rewriting this application into Cake3 could be very time-consuming.

Now, I need o extend this application with lots of functionality. More and more CRUD's.

Application interface must look same, there must be single authorization and authentication provided by old app, or maybe rewritten into new app.

Now, is there any way, that existing application ( in Cake2 ) could work on same domain with Cake3?

I know that added functionality could work on subdomain like

  • Cake2 app is domain.tld
  • Cake3 app is storage.domain.tld

but how complicated, problematic could be set things as

  • domain.tld/[beefs|chips|sausages] <- Cake2
  • domain.tld/storage <- Cake3

Opinions?


Solution

It's pretty easy. Just configure your webserver to route /storage to your Cake3 app and all other to the Cake2 app.

  • Configure nginx with multiple locations with different root folders on subdomain (concept is the same)
  • https://www.nginx.com/blog/creating-nginx-rewrite-rules/
  • Google knows a lot more :)


Answered By - floriank
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing