Answer the question
In order to leave comments, you need to log in
How to redirect to OpenCart via php?
There was a problem with rewriting links.
With the command:
$this->response->redirect($this->url->link($redirect_roots,301));
//$redirect_roots наша строка. например " /scanner/brend/hp/"
Answer the question
In order to leave comments, you need to log in
Though I haven't come across OpenCart. But almost all engines by default throw any links to the main script router (for example, index.php). That's why you get the line index.php?route=/scanner/brend/hp/&301=
Look at the $this->url->link sources, with a high degree of probability you will see the link conversion there so that the link starts with index.php.
But if you feed a ready-made link to the redirect method right away,
then most likely you will get what you need.
I'm almost sure that something like this is implemented in this method:
header('Location: ' . $url);
exit;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question