How to restrict acces to specific friendly URL by IP in Wordpress site?

Igal @ igal at
Fri May 19 22:20:14 UTC 2017

On 5/19/2017 3:14 PM, Alex Samad wrote:
> On 20 May 2017 at 08:00, <lists at 
> <mailto:lists at>> wrote:
>     My experience with deny in nginx is the url isn't hidden
> So you don't want to just restrict access but you want to send a 404 
> not found unless they come from a specific ip address.

"deny" by default will return 403.  if you want to return 404 instead 
you can do something like the following:

### return 404 for requests to /404.internal
location =  /404.internal { internal; }

### send 403 to /404.internal to return 404 code instead
error_page  403 =404 /404.internal;

Of course, if you have a custom 404 page you can use it instead of the 
/404.internal, but this is a simple way that doesn't rely on any 
additional resources.

Igal Sapir
Lucee Core Developer <>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list