Rewrite rule with in url

Hi - I’ve got a plugin which was misconfigured - and now I need to
rewrite a
string - however I cannot find out at all how to do this for urls with ?
in
them.

So I need to have:
www.velomap.org/de/?s2member_paypal_notify=1
rewritten to www.velomap.org/?s2member_paypal_notify=1
(note the /de missing).

I tried:
server { server_name www.velomap.org/de/?s2member_paypal_notify=1
return 301
$scheme://www.velomap.org/?s2member_paypal_notify=1$request_uri?;
}

but this is not accepted as valid nginx.conf…

So I need this rewritten and it is important that whatever string is
following this is not lost…

(also - but less important) - how can I rewrite a specific url?
So I want to rewrite
www.velomap.org/de/
to www.velomap.org

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,258420,258420#msg-258420

Will this work correctly with all the arguments followed?

location = /de/ {
if ( $arg_s2member_paypal_notify ) {
rewrite ^ / permanent;
}
}

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,258420,258422#msg-258422

okay - I noticed my homepage wouldn’t load for www.velomap.org/de/
anymore
with this rule -

location = /de/ {
if ( $arg_s2member_paypal_notify ) {
rewrite ^ / permanent;
}
try_files $uri $uri/ /index.php;
}

Seems to work - well I hope this is passing on all information correctly
still…

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,258420,258424#msg-258424

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs