Answer the question
In order to leave comments, you need to log in
How to make a redirect from a non-existent $_GET parameter?
I have the following index.php structure , which is responsible for my $_GET addresses.
$param[0] is the first get parameter, say site.ru/news. Here I did a check for non-existent addresses where $param[0].
Now the task is to redirect to the main page from a non-existent $param, where it can be $param[0,1,2,3], for example site.ru/news[0]/good[1]/jek[2]/ass [3 - non-existent parameter, it is from it that you need to redirect to the main one.]
Answer the question
In order to leave comments, you need to log in
You need to send 301 HTTP response: www.kobzarev.com/programming/301-moved-permanently.html
<?php
header("Location: http://www.example.com", true, 301);
exit();
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question