Search code examples
apache.htaccessipv6

IP redirect IPv6 HTTP:X-FORWARDED-FOR


I cant seem to get a straight answer anywhere. Would this line work to IP lock a page?

RewriteCond %{HTTP:X-FORWARDED-FOR} !(89.101.70.19 | 2a02:8084:6aa0:6980:2ce9:7fcd:a298:2313)

Solution

  • If you want to lock a website to a specific IP use the following in your .htaccess:

    Order Deny,Allow
    Deny from all
    Allow from 89.101.70.19
    Allow from 2a02:8084:6aa0:6980:2ce9:7fcd:a298:2313