Restrict single url for a single IP

I have denied all IPs except few in htaccess file.

Now I want a new IP to allow access only 1 particular url (it is not a html page but a page from wordpress). I do not want this IP to access other content of the website.

Read More

I do not want password protection as it will affect all other users.

Can we do something like that ?

Related posts

1 comment

  1. Add the new ip to the list of allowed ones, then restrict it to access all uris except to the allowed one.

    Assume that you want to deny access of the user with IP:124.255.124.255 to all urls except of www.example.com/url-to-hide .After granting access to all urls, Put the following code in .htaccess file of the root directory:

    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{REMOTE_ADDR} ^124.255.124.255 
    RewriteCond %{REQUEST_URI} !^/url-to-hide$
    RewriteRule ^(.*)$ - [F,L]
    

Comments are closed.