How to redirect only single ip traffic to a website? php

Joined
Mar 19, 2022
Messages
16
Reaction score
2
I have a website, but I just want to redirect traffic from another website by filtering the unique ip

Can someone shed some light on where to start?
 
i mean i want to filter the same ip every 24 hours to visit my site
 
If you are using a php script rather than an application and you are looking for a quick and easy hack, something along the lines of

PHP:
if($_SERVER['REMOTE_ADDR'] === '123.123.123.123'){
    header('Location: https://somenewaddr.com');
    exit();
}
 
Use something like AaPanel, it will ease your work with PHP applications, redirects, etc.
 
I have a website, but I just want to redirect traffic from another website by filtering the unique ip

Can someone shed some light on where to start?
You can filter IPs using server-side scripts (PHP, Node.js) or configure your web server (Apache, Nginx) to redirect based on specific IPs. Just maintain a list of the IPs you want to redirect.
 
Honestly, I'm not super familiar with doing it by IP but I'm curious why you want to filter by unique IPs instead of just redirecting all traffic?
 
Back
Top