Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
if(count($_GET) > 0 || substr($_SERVER['REQUEST_URI'], -1) == '?') header('Location: /');
count($_GET) > 0will check if GET parameters were passed. But if the query is just
site.ru/?, the condition will return 0. Therefore, the second condition is to check if there is a question mark at the end of the query.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question