Welcome! Log In Create A New Profile

Advanced

Re: Rewrite rules from Apache again

Francis Daly
June 10, 2014 05:44PM
On Tue, Jun 10, 2014 at 06:00:13PM +0200, Luciano Mannucci wrote:

Hi there,

> works pretty weff if turned into:
>
> rewrite ^/(.*)_k(.*).htm$ /pagina.php?k=$2 ;

> does not work if translated as:
>
> rewrite ^/privacy.php$ /pagina.php?k=privacy ;
>
> the request is passed unchanged and I get a 404 error for the
> /privacy.php page does'nt exist.
>
> What did I miss?

The rest of the config?

==
server {
rewrite ^/(.*)_k(.*).htm$ /pagina.php?k=$2 ;
rewrite ^/privacy.php$ /pagina.php?k=privacy ;

location = /pagina.php {
return 200 "I got $uri$is_args$args from $request_uri\n";
}
}
==

seems to work as expected for me, for requests like /privacy.php and
/a_k_b.htm?key=value.

What do you have that is different?

f
--
Francis Daly francis@daoine.org

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

Rewrite rules from Apache again

Luciano Mannucci June 10, 2014 12:02PM

Re: Rewrite rules from Apache again

Francis Daly June 10, 2014 05:44PM

Re: Rewrite rules from Apache again

Luciano Mannucci June 11, 2014 12:22PM

Re: Rewrite rules from Apache again

Francis Daly June 11, 2014 01:06PM

Re: Rewrite rules from Apache again

Luciano Mannucci June 12, 2014 09:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 178
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