Welcome! Log In Create A New Profile

Advanced

Re: How could I permanently redirect dynamic url with querystrings?

Gena Makhomed
June 20, 2010 08:44AM
On 20.06.2010 14:06, WisdomFusion wrote:

>> - rewrite ^.*$ http://www2.example.com/thread-$tid-1-1.html permanent;
>> + rewrite ^ http://www2.example.com/thread-$tid-1-1.html? permanent;

>> - rewrite ^(.*) http://www2.example.com$1 permanent;
>> + rewrite ^ http://www2.example.com$request_uri? permanent;

> Thanks. ^^
>
> It works perfect. Thanks a lot.
>
> By the way, I always refers to configuration from
> http://wiki.nginx.org/NginxHttpRewriteModule, but it's so brief that
> some details like this problem I encountered are not included. Where
> could I find more detailed reference materials?

high quality English documentation can be located
at official nginx site: http://nginx.org/en/docs/

information about "question mark as the last character"
present at http://wiki.nginx.org/NginxHttpRewriteModule:

If in the line of replacement arguments are indicated, then the rest of
the request arguments are appended to them. To avoid having them
appended, place a question mark as the last character:

rewrite ^/users/(.*)$ /show?user=$1? last;

'^' character is pcre regexp, it means 'start of string',
more detailed manual about Perl Compatible Regular Expressions
syntax is http://perldoc.perl.org/perlre.html
or http://www.pcre.org/pcre.txt

$request_uri - internal nginx variable,
it described at http://wiki.nginx.org/NginxHttpCoreModule

P.S.

quite often English documentation at http://wiki.nginx.org/
are more detailed than russian http://sysoev.ru/nginx/docs/
(wiki describes many undocumented nginx options and features)

but Russian documentation at http://sysoev.ru/nginx/docs/
always more accurate and correct than information at wiki,
because Russian documentation maintained in sync
with main development branch by creator of nginx.

it can be readed in english via Google Translate.

--
Best regards,
Gena

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

How could I permanently redirect dynamic url with querystrings?

WisdomFusion June 19, 2010 09:53AM

Re: How could I permanently redirect dynamic url with querystrings?

Gena Makhomed June 19, 2010 10:34AM

Re: How could I permanently redirect dynamic url with querystrings?

WisdomFusion June 20, 2010 07:06AM

Re: How could I permanently redirect dynamic url with querystrings?

Gena Makhomed June 20, 2010 08:44AM

Re: How could I permanently redirect dynamic url with querystrings?

WisdomFusion June 21, 2010 09:58PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 184
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready