Answer the question
In order to leave comments, you need to log in
Redirecting a 404 page to another site with the same url?
Hello.
Moved the site to a new domain.
Hung a new site on the old domain.
Now you need to redirect pages from the old site to the new one, so that the new site on the old domain continues to work.
In general, the meaning is this:
I added the following code to the page that is shown with a 404 error:
<?php
header('Location: https://www.новый-урл.ru".$_SERVER['REQUEST_URI']');
?>
Answer the question
In order to leave comments, you need to log in
Lots of quotes?
header('Location: https://www.новый-урл.ru'.$_SERVER['REQUEST_URI']);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question