This code is not displaying the referrer URL of the website from which the user has come to the current page. Instead, it is displaying the website base URL any idea why it is happening? It is working fine on my website. when the user moves from product to contact page etc. I also tried this too.
but not working.
Here is my current code
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $redirect = $objectManager->create('\Magento\Framework\App\Response\RedirectInterface'); echo $redirect->getRefererUrl();
Expected Result: http://www.previouswebsite.com/