Answer the question
In order to leave comments, you need to log in
How to redirect php referral link?
There are a lot of links with different i at the end https://test.ru/?i=717956 https://test.ru/?i=123 https://test.ru/?i=1234
How to redirect them to the site https://dom.com/?i=717956 https://dom.com/?i=123 https://dom.com/?i=1234
Do not redirect https://test.ru/
Answer the question
In order to leave comments, you need to log in
if ($i = filter_input(INPUT_GET, 'i', FILTER_VALIDATE_INT)) {
header('location: https://dom.com/?i=' . $i);
exit();
}
If using .htaccess, judging by the tag, then something like this:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^i=\d+$
RewriteRule ^$ https://dom.com/ [R=301,L,QSA]
index.php-
<?php
echo file_get_contents('https://dom.com/?i='.$_GET['i']);
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question