Welcome! Log In Create A New Profile

Advanced

Re: Redirect specific query to a page

António P. P. Almeida
January 18, 2013 08:54PM
On 19 Jan 2013 02h21 CET, ondanomala_albertelli@yahoo.it wrote:

> I moved my website from Joomla to WordPress.. I'd like to redirect
> www.website.com/?option=com_content&view=article&id=164&Itemid=139
> to www.website.com/listituto/contatti/ (so, same domain).
>
> I tried with this line (both within the / location and outside it):
>
> rewrite /?option=com_content&view=article&id=164&Itemid=139
> /listituto/contatti/ permanent;

Try with a map. At the http level:

set $arg_str $arg_option$arg_view$arg_id$arg_itemid;

map $arg_str $redirect_contact {
default 0;
com_contentarticle164139 1;
}

Then do at the server (vhost) level:

if ($redirect_contact) {
return 301 $scheme://$host/listituto/contatti;
}

Remember that the argument order can change and that your rewrite
already takes the arguments in consideration. You need to add a '?' at
the end of the replacement to omit the arguments from it.

See: http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite

--- appa

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

Redirect specific query to a page

OndanomalA January 18, 2013 08:22PM

Re: Redirect specific query to a page

António P. P. Almeida January 18, 2013 08:54PM

Re: Redirect specific query to a page

OndanomalA January 19, 2013 09:46AM

Re: Redirect specific query to a page

António P. P. Almeida January 19, 2013 01:00PM

Re: Redirect specific query to a page

OndanomalA January 19, 2013 08:30PM

Re: Redirect specific query to a page

António P. P. Almeida January 19, 2013 09:44PM

Re: Redirect specific query to a page

Vadim Lazovskiy January 20, 2013 08:02AM

Rewrite rules with NGinx

miky January 20, 2013 10:24AM

Re: Rewrite rules with NGinx

Francis Daly January 20, 2013 10:52AM

Re: Rewrite rules with NGinx

miky January 20, 2013 11:36AM

Re: Rewrite rules with NGinx

Francis Daly January 20, 2013 12:02PM

Re: Rewrite rules with NGinx

António P. P. Almeida January 20, 2013 12:24PM

Re: Redirect specific query to a page

OndanomalA January 20, 2013 07:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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