Home » Php » How can I use Slim micro framework inside Drupal?

How can I use Slim micro framework inside Drupal?

Posted by: admin June 30, 2018 Leave a comment

Questions:

Good Morning,
I have a question about using Slim inside Drupal : I have an existing website project made with Drupal inside my apache server. My work was to add another part to the existing website and I decided to work without Drupal but with Slim micro framework (v2). After finishing my website, I created a folder inside the root of the Drupal project folder and I puted my website inside this folder.

This is how the Drupal folder looks with the new folder.
(folders may be scripts, misc,… and files may be .htaccess, index.php,…)

After that I try to access to my website with this URL : http://www.thewebsite.com/MYNEWFOLDER/ and it redirect me to the route “/” that I have added inside my route.php file : everything is normal.

$app->get('/', function () use ($app){
MYCODE});

Then I try http://www.thewebsite.com/MYNEWFOLDER/admin because there is a route “/admin” that I have also added inside my route.php file but instead of accessing to this part of the website, it redirect me to a drupal error 404 page which says : ‘”MYNEWFOLDER/admin” not found.’.

$app->get('/admin(/)', function (){
MYCODE});

My question is : how can I tell to Drupal this folder MYNEWFOLDER has to be ignored AND how can I access to http://www.thewebsite.com/MYNEWFOLDER/admin without being redirected by Drupal ?

Have a nice day !

(Sorry for my English btw ^^)

Answers: