Welcome! Log In Create A New Profile

Advanced

location and rewrite directive

Posted by zaphod 
location and rewrite directive
May 09, 2009 04:00PM
I tried to redirect an specifique url

this url is "/competitors?sort=name_categories.name" to "/articles"

my conf is :

server {
...
location ~* ^/competitors(.*)$ {
if ($args ~* ^sort=name_categories.name$){
set $args "";
rewrite ^(.*)$ $scheme://$host/articles redirect;
break;
}
}
location / {
....
}
}

this code work perfecltly for the url /competitors?sort=name_categories.name but i can't acces to /competitors now ...

You can help me ?
Thanks.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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