diff --git a/cli/drivers/Magento2ValetDriver.php b/cli/drivers/Magento2ValetDriver.php index 339179e..d33341c 100644 --- a/cli/drivers/Magento2ValetDriver.php +++ b/cli/drivers/Magento2ValetDriver.php @@ -35,6 +35,7 @@ public function isStaticFile($sitePath, $siteName, $uri) { $this->checkMageMode($sitePath); + $uri = $this->handleForVersions($uri); $route = parse_url(substr($uri, 1))['path']; $pub = ''; @@ -72,6 +73,17 @@ public function isStaticFile($sitePath, $siteName, $uri) return false; } + /** + * Rewrite URLs that look like "versions12345/" to remove + * the versions12345/ part + * + * @param string $route + */ + private function handleForVersions($route) + { + return preg_replace('/version\d*\//', '', $route); + } + /** * Determine the current MAGE_MODE *