Home > Back-end >  Redirect an IP Address with .htaccess
Redirect an IP Address with .htaccess

Time:01-10

I use LiteSpeed and I’m wondering what code I need to add to my .htaccess file to redirect certain IP addresses to another link/website. Thanks!

CodePudding user response:

Something like the following :

RewriteEngine On

RewriteCond %{REMOTE_ADDR} ^1\.2\.3\.4\.5$
RewriteRule ^ https://example.com [L,R]

This redirects the client with ip address 1.2.3.4.5 to example.com.

  •  Tags:  
  • Related