I was wondering if somebody might have a solution for me. Currently I have a working IndexController which brings back the correct sku from a search.
However the problem is that once the rewrite is made it adds the complete URL which does not link to a product page.
// Check we have a product.
if ($product->getId()) {
// Get the URL and redirect to it.
$url = $product->getProductUrl();
if ($url) {
$this->_redirectUrl('/support/'.$url);
return true;
}
}
// If we didn't find a matching product, load the default.
$this->loadNoRoute();
return false;
It then proceeds to load a URL like this: https://mywebiteurl/support/https://mywebsiteurl/macbook-pro.html
Where I require the URL to load like this: https://mywebiteurl/support/macbook-pro.html
Wondering if anybody could point me in the right direction as I'm going round in circles. Any help would be appreciated.
Thanks.