i want to redirect from observer to the default magento product url from observer.
public function __construct(
\Magento\Framework\App\ResponseFactory $responseFactory
) {
$this->_responseFactory = $responseFactory;
}
public function execute(Observer $observer) {
$productUrl = $currentProduct->getProductUrl();
//$RedirectUrl= $this->_url->getUrl('chennaievent\index\index');
return $this->_responseFactory->create()->setRedirect($productUrl)->sendResponse();
}
}