isSalesChannelRequest example

$this->requestStack = $requestStack;
        $this->maintenanceModeResolver = $maintenanceModeResolver;
    }

    /** * shouldRedirect returns true, when the given request should be redirected to the maintenance page. * This would be the case, for example, when the maintenance mode is active and the client's IP address * is not listed in the maintenance mode whitelist. */
    public function shouldRedirect(Request $request): bool
    {
        return $this->isSalesChannelRequest()
            && !$request->attributes->getBoolean(PlatformRequest::ATTRIBUTE_IS_ALLOWED_IN_MAINTENANCE)
            && !$this->isXmlHttpRequest($request)
            && !$this->isErrorControllerRequest($request)
            && $this->isMaintenanceRequest($request);
    }

    /** * shouldRedirectToShop returns true, when the given request to the maintenance page should be redirected to the shop. * This would be the case, for example, when the maintenance mode is not active or if it is active * the client's IP address is listed in the maintenance mode whitelist. */
    
Home | Imprint | This part of the site doesn't use cookies.