Redirect a specific IP address to a special page of my homepage with .htaccess

后端 未结 2 1957
死守一世寂寞
死守一世寂寞 2021-01-22 00:07

How can I use .htaccess to forward a visitor of a specific IP address to a webpage on my server?

This example causes an infinite loop:

RewriteCond %{REMO         


        
2条回答
  •  清酒与你
    2021-01-22 01:04

    Just figured out the solution:

    RewriteCond %{REMOTE_ADDR} ^123\.\123\.123\.123$
    RewriteCond %{REQUEST_URI} !/specialpage.php
    RewriteRule .*\.(htm|html|php)$ /specialpage.php [R,L]
    

    Thank you for your help!

提交回复
热议问题