Answer the question
In order to leave comments, you need to log in
301 redirect to php (wordpress)?
1. You need to make a lot of redirects to php, I found this code on the net
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.ru/newdir/newpage.htm");
exit();
?>
but I don't understand where to set the old url here.
2. Will a lot of redirects through .htaccess slow down the performance of the site?
Answer the question
In order to leave comments, you need to log in
Alternatively, you can check the old URL directly in the code and call the transition according to the condition.
Something like
if($_SERVER['REQUEST_URI'] == '/oldurl/'){
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.ru/newdir/newpage.htm");
exit();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question