M
M
Maxim Tsyplenkov2019-08-07 17:40:20
PHP
Maxim Tsyplenkov, 2019-08-07 17:40:20

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']');
?>

Where is the error in the code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wagoodoogoo, 2019-08-07
@maxim_tsyplenkov

Lots of quotes?

header('Location: https://www.новый-урл.ru'.$_SERVER['REQUEST_URI']);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question