Answer the question
In order to leave comments, you need to log in
How to write redirects correctly?
There is a link like
view.php?id=107
This link used to have a page that is now located at
view/shampun_eva
Id of these records match, that is, I can find the url 107 of the record in the database and redirect
header("Location:/view/ shampoo_eva").
Is this the correct method?
Will it affect SEO?
Answer the question
In order to leave comments, you need to log in
I wonder why the task for the web server is solved using php?
map $arg_id $redirect_to {
107 /view/shampun_eva;
108 /view/shampun_eva2;
109 /etc
default noredirect;
}
server {
....
if ( $redirect_to != "noredirect" ) { return 301 $scheme://$http_host$redirecto ; }
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question