6 declare(strict_types=1);
28 private $requestFactory;
36 \
Magento\Framework\HTTP\PhpEnvironment\RequestFactory $requestFactory
38 $this->urlFinder = $urlFinder;
39 $this->requestFactory = $requestFactory;
50 $targetUrl = $redirectUrl;
52 $request = $this->requestFactory->create([
'uri' => $targetUrl]);
54 $urlPath = ltrim(
$request->getPathInfo(),
'/');
56 if ($targetStore->isUseStoreInUrl()) {
60 $urlPath = preg_replace(
$pattern,
'', $urlPath);
63 $oldStoreId = $fromStore->
getId();
64 $oldRewrite = $this->urlFinder->findOneByData([
70 $currentRewrite = $this->urlFinder->findOneByData([
74 if (
null === $currentRewrite) {
76 $targetUrl = $targetStore->getBaseUrl();
__construct(UrlFinderInterface $urlFinder, \Magento\Framework\HTTP\PhpEnvironment\RequestFactory $requestFactory)