Welcome! Log In Create A New Profile

Advanced

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

Igal @ Lucee.org
May 19, 2017 05:50PM
Hello,

On 5/19/2017 12:24 AM, ohmykot wrote:
> What I tried so far in my website config:
> [code]
> location ~* ^/secret-page/ {
> allow 1.1.1.1;
> deny all;
> }
> [/code]
>
> But this didn't work. It returns 404 error when I try to open this page from
> allowed IP. Looks like it tried to find the real file or directory
> /secret-page/ rather than return a friendly URL page if I got it right.

I assume that you mean rewritten URL when you say Friendly URL? Please
paste your rewrite rule for that location.

But in general I think that you should remove the rewrite rule for that
location, and add the following:

Assuming that you mean a secret directory rather than page, add alias or
root directive, e.g.

location ~* ^/secret-page/ {

allow 1.1.1.1;
deny all;

alias /path/to/physical/secret-dir/;
}


If it really is a single page then try:

location = /secret-page/ {

allow 1.1.1.1;
deny all;

try_files /path/to/physical/file
}


Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

ohmykot May 19, 2017 03:24AM

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

alexsamad May 19, 2017 05:38PM

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

gariac May 19, 2017 06:02PM

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

alexsamad May 19, 2017 06:16PM

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

Igal @ Lucee.org May 19, 2017 06:22PM

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

Igal @ Lucee.org May 19, 2017 06:48PM

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

gariac May 19, 2017 07:04PM

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

Igal @ Lucee.org May 19, 2017 07:10PM

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

Igal @ Lucee.org May 19, 2017 05:50PM

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

ohmykot May 22, 2017 03:24AM

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

Aleksandar Lazic May 19, 2017 07:42PM

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

Francis Daly May 22, 2017 07:10PM

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

gariac May 22, 2017 07:54PM

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

Francis Daly May 27, 2017 03:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 231
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready