0

I am using Valet+ for my Magento projects.
Currently I’m trying to add WP integration for M2 project. I put wordpress copy into pub/wp/ directory and want to go through the installation process, but I’m receiving 404 error when I’m trying to access url like https://magento2.test/wp/
Could anyone advice for it? Thank you!

Han Li
  • 41
  • 5

1 Answers1

0

You can use custom valet driver for it.

Copy Magento2ValetDriver.php into magento root directory and rename it to LocalValetDriver.php
Also, change the class name to LocalValetDriver in it.

In the function frontControllerPath, add the following code at the top.

if ($uri === '/wp') {
    $_SERVER['DOCUMENT_ROOT'] = $sitePath . '/pub/wp';
    return $sitePath . '/pub/wp/index.php';
}
Han Li
  • 41
  • 5