Mailing List Archive

Rewrite from IP:Port to specific path
Hi,

I'm dealing with a particular need about give access to requests made from
specific IP:Port to a certain URL and nothing more.

This is what I got so far, I'm in doubt if would work

RewriteEngine On
RewriteCond %{REMOTE_ADDR}%{REMOTE_PORT} ^1\.2\.3\.4:8022$
RewriteRule .* /aplicacion.php?a=12.34&b=modulo||110000003 [R=302,L]
Re: Rewrite from IP:Port to specific path [ In reply to ]
On Mon, Sep 28, 2020 at 5:34 PM Daniel Armando Rodriguez
<drodriguez@epet1.edu.ar> wrote:
>
> Hi,
>
> I'm dealing with a particular need about give access to requests made from specific IP:Port to a certain URL and nothing more.
>
> This is what I got so far, I'm in doubt if would work
>
> RewriteEngine On
> RewriteCond %{REMOTE_ADDR}%{REMOTE_PORT} ^1\.2\.3\.4:8022$

need ":" separator in the first arg between the vars to match the regex

> RewriteRule .* /aplicacion.php?a=12.34&b=modulo||110000003 [R=302,L]

this will probably loop, you need a condition that stops it from redirecting.



--
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Rewrite from IP:Port to specific path [ In reply to ]
El lun., 28 de sep. de 2020 a la(s) 19:11, Eric Covener (covener@gmail.com)
escribió:

> On Mon, Sep 28, 2020 at 5:34 PM Daniel Armando Rodriguez
> <drodriguez@epet1.edu.ar> wrote:
> >
> > Hi,
> >
> > I'm dealing with a particular need about give access to requests made
> from specific IP:Port to a certain URL and nothing more.
> >
> > This is what I got so far, I'm in doubt if would work
> >
> > RewriteEngine On
> > RewriteCond %{REMOTE_ADDR}%{REMOTE_PORT} ^1\.2\.3\.4:8022$
>
> need ":" separator in the first arg between the vars to match the regex
>
> Thanks, didn't see that


> > RewriteRule .* /aplicacion.php?a=12.34&b=modulo||110000003 [R=302,L]
>
> this will probably loop, you need a condition that stops it from
> redirecting.
>

Well the intention is redirect all inbound traffic to a particular URL